Hello,
I am new to PHP development and want to explore the features of PHP..
I have installed : php-5.2.6-win32-installer.msi setup along with
: apache_2.2.8-win32-x86-no_ssl.msi
In application when i add namespace as mention in following code
<?php
nampespace MyNamespace ;
class Test
{
public function hello()
{
echo 'Hello';
}
}
?>
it gives the following Error :
Parse error: syntax error, unexpected T_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\DemoApps\Namespaces.php on line 2...
please help me to sortout this problem..
Is like that my PHP version not supports namespaces or I need to add something more..
Thanks in advance..
Regarding Namespace
Moderator: General Moderators
Re: Regarding Namespace
I'm not too sure ... but maybe you need to spell namespace correctly.
Any help there?
Code: Select all
//nampespace MyNamespace;
namespace MyNamespace;-
iworktech_kiran
- Forum Newbie
- Posts: 4
- Joined: Fri Sep 26, 2008 1:11 am
Re: Regarding Namespace
Stryks wrote:I'm not too sure ... but maybe you need to spell namespace correctly.
Any help there?Code: Select all
//nampespace MyNamespace; namespace MyNamespace;
No ... Actually while typing i miss speld .
but in a code it is correct i.e namepace ..but still not working..
-
iworktech_kiran
- Forum Newbie
- Posts: 4
- Joined: Fri Sep 26, 2008 1:11 am
Re: Regarding Namespace
iworktech_kiran wrote:Stryks wrote:I'm not too sure ... but maybe you need to spell namespace correctly.
Any help there?Code: Select all
//nampespace MyNamespace; namespace MyNamespace;
No ... Actually while typing i miss speld .
but in a code it is correct i.e namespace ..but still not working..
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
-
iworktech_kiran
- Forum Newbie
- Posts: 4
- Joined: Fri Sep 26, 2008 1:11 am
Re: Regarding Namespace
arborint wrote:I thought namespaces were only available in PHP 5.3.0.
Ok ..
Thanks for your help..
- The_Anomaly
- Forum Contributor
- Posts: 196
- Joined: Fri Aug 08, 2008 4:56 pm
- Location: Tirana, Albania
Re: Regarding Namespace
Heck, last thing I read said that Namespaces werent' implemented in PHP at all. Was listed as evidence for PHP not being a "fully" OOP language.arborint wrote:I thought namespaces were only available in PHP 5.3.0.
That must have been written a while ago then.