Urgent questions PHP version of the problem, 12:10 the younger brother I have not eaten, everyone help!

Source: Internet
Author: User
Urgent questions PHP version of the problem, 12:10 I have not eaten, everyone help!!
Hello, I used in the program WebSocket function, the program debugging no error, but to the service error, found on the internet, said PHP version of a http://s.yanghao.org/program/viewdetail.php?i=140457
The PHP version of my machine is 5.4, the server is 5.2, please PHP5.2 there is no convenient to replace the php5.3 namespace function, very urgent!
Require ("lib/splclassloader.php");
$classLoader = new Splclassloader ("WebSocket", "/lib");
$classLoader->register ();
$server = new \websocket\server ("124.172.243.71", 8000, false);//Error here
The contents of the error are as follows
Unexpected character in input: ' \ ' (ascii=92) state=1 in version


------Solution--------------------
A reply in the manual
--------------------------------------------------
A dot schaffhirt at sedna-soft Dot de02-feb-2010 06:24

Just in wonder, what the practical use of the namespace keyword is ...

It can explicitly refer to classes from the current namespace regardless of possibly ' use ' d classes with the same name fro M other namespaces. However, this does is not an apply for functions.

Example:

namespace Foo;
Class Xyz {}
Function abc () {}
?>

namespace Bar;
Class Xyz {}
Function abc () {}
?>

namespace Bar;
Use Foo
------Solution--------------------
Xyz;
Use Foo
------Solution--------------------
abc
New Xyz (); Instantiates \foo\xyz
New namespace
------Solution--------------------
Xyz (); Instantiates \bar\xyz
ABC (); Invokes \BAR\ABC regardless of the second use statement

------Solution--------------------
Ho!
------Solution--------------------
ABC (); It has-to-be invoked using the fully qualified name
?>

(Sorry, I had to use "
------Solution--------------------
"Instead of" \ ", as it is always discarded in the preview, except within a comment.)

Hope, this can save someone from some trouble.

Best regards.
----------------------------------------
------Solution--------------------
There are no namespaces in PHP5.2
You can delete the Declarations section about namespaces.
Degenerate into normal classes and functions
  • 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.