Stupid problem with namespace

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Why doesn't this code work?

namespace MyProject; // this is line 2

class A {
  function say_hello() {
    echo "Hello";

The error is: "Parse error: syntax error, unexpected T_STRING in C:
\Inetpub\wwwroot\MyProject\MieClassi.php on line 2"


Re: Stupid problem with namespace

Quoted text here. Click to load it

Namespaces are available in PHP as of PHP 5.3.0. This section is  
experimental and subject to changes.

Unless you use development snapshots, I don't think you have PHP5.3.0 or  
Rik Wasmus

Site Timeline