Unexpected T_STRING in PHPWebSocket
I was trying to test some HTML5 WebSockets using phpwebsocket, but I got an error while trying to execute the server script:
Nathan-Campos-MacBook-Pro:socket Nathan$ php -q server.php
Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/socket/server.php on line 109
Nathan-Campos-MacBook-Pro:socket Natha开发者_运维知识库n$
What I should make to correct the error?
I'm using PHP 5.3.3 and here is the content of line 109:
socket_close($user->socket);
I got the same problem. this is How I solve it. copy all the code in server.php and paste it in Eclipse in which you create a untitle php file. then you can inspect the line 109, where there are three extra dots, remove them and update what you have. i am sure this will solve it.
I think it's the format problem when you copy the server.php code. first time, I copy the code from Editor Panel, this problem was occured. so I had make a new copy from here, and successed to run the server.php :)
精彩评论