Nathan Campos
Nathan Campos

Reputation: 29497

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 Nathan$

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);

Upvotes: 0

Views: 567

Answers (2)

CodingMonkey
CodingMonkey

Reputation: 135

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 :)

Upvotes: 0

bingjie2680
bingjie2680

Reputation: 7773

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.

Upvotes: 1

Related Questions