Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
807 stars 341 forks source link

Parse error: syntax error, unexpected '[' in C:\inetpub\wwwroot\Telegram.php on line 72 #191

Closed matze1708 closed 4 years ago

matze1708 commented 5 years ago

Hello,

i had allready used your Bot for a longer Time.

Acutally i migirate all PHP Documents from our old Win Server 2008R2 with IIS to our newer Server2019 with IIS

PHP is installed allready.

When I try to execute my PHP File, this Error Message will be prompt.

Parse error: syntax error, unexpected '[' in C:\inetpub\wwwroot\ProMember\include\Telegram\Telegram.php on line 72

I´ve tried this with the older Version from Telegram.php. Error happens on the Same Place in Document.

private $bot_token = ''; private $data = []; private $updates = []; private $log_errors; private $proxy;

Error is on private $data = []; or above .

What can i do to fix this?

Eleirbag89 commented 5 years ago

You can try:

private $data = array();
private $updates = array();

But can be other places where this syntax is used. However, te square brackets where introduced in php 5.4., wich version are you using ?

matze1708 commented 5 years ago

i have tried.

the error on this line ist gone, but the error came on the next line, where [] is used.

The php Version in this Windows Server is 5.3 is the Same Version like on the old one.

I think there is a Option on php to actived this kind of arrays .