|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Why doesn't this code work?
<?php 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" Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Fri, 15 Feb 2008 14:53:00 +0100, <aalberani@gmail.com> wrote:
> Why doesn't this code work? > > <?php > 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" http://nl2.php.net/manual/en/language.namespaces.php Quote: 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 higher... -- Rik Wasmus |
|
![]() |
| Outils de la discussion | |
|
|