I am eager to ask for questions about the PHP namespace. I haven't eaten yet, younger brother. thank you for your help!

Source: Internet
Author: User
I am eager to ask for a question about the PHP namespace. I haven't eaten yet at PM. please help me !! Hello everyone, I have used the websocket function in the program. there is no error in local debugging of the program, but an error is reported when I transfer it to the service. I found it online and said it was a PHP version of s. yanghao. orgprogramviewdetail. php? I140457 the PHP version on my machine is 5.4, and the server is 5.2. may I ask P for an emergency question about the PHP namespace? I haven't eaten yet at PM. please help me !!
Hello everyone, I used the websocket function in the program, the local program debugging does not report an error, but the transfer to the service will report an error, found on the Internet, said PHP version of a http://s.yanghao.org/program/viewdetail.php? I = 140457.
The PHP version on my machine is 5.4 and the server is 5.2. is it convenient to replace the namespace function of php5.3 in PHP5.2!
Require ("lib/SplClassLoader. php ");
$ ClassLoader = new SplClassLoader ("WebSocket", "/lib ");
$ ClassLoader-> register ();
$ Server = new \ WebSocket \ Server ("124.172.243.71", 8000, false); // An error is returned here.
The error message is as follows:
Unexpected character in input: '\' (ASCII = 92) state = 1 in


------ Solution --------------------



PHP versions later than 5.3.0 support namespaces.
So you should upgrade the server.


------ Solution --------------------
M, not familiar with namespaces

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.