为什么我的php脚本会向我的机器人发送多条消息?

I create a Telegram bot.
Setup webhook to file in hosting.

Below php script:

<?php
include_once '../simple_html_dom.php';

global $connect;
$connect=new mysqli("localhost","","","");
$connect->query("SET NAMES 'utf8'");

$string_input = file_get_contents('php://input');
$string_input = json_decode($string_input);

$text=$string_input->{'message'}->{'text'};

if ($text=="start"){
    sendMessage(1);
    first($connect);
    sendMessage(2);
    second($connect);
    sendMessage(3);
    third($connect);
    sendMessage(4);
}

function first(connect){...}    

function second(connect){...}

function third(connect){...}

function sendMessage($i) {
    $chatID="...";
    $token="...";

    $url = "https://api.telegram.org/bot" . $token . "/sendMessage?chat_id=" . $chatID;
    $url = $url . "&text=" . urlencode($i);
    $ch = curl_init();
    $optArray = array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true
    );
    curl_setopt_array($ch, $optArray);
    $result = curl_exec($ch);
    curl_close($ch);

    return $result;
}
?> 

And messages in telegram bot:

 ~ start  

1
2
3
4
1
3
2
4
1
2
3
3
1
4
2
1
2 

The functions are not called immediately, each about 1 minute apart. Everything works fine when performing without a function: 1,2,3,4.