Problems with PHP 5.0.2 and OOP
Posted: Mon Mar 19, 2007 11:48 am
Hi
I'm working on a site for a client who uses Lycos.co.uk for their webhosting. Lycos claims that they have PHP 5.0.2 installed on their servers, and to use PHP5 you just have to name your scripts with a .php5 extension.
I'm trying to run a class with protected and private vars, preset vars etc common to OOP in PHP5.
However, the errors I get when I run the page are due to the protected / private keywords and the assignment outside a function. Googling them say the cause is running PHP5 on a PHP4 enabled server.
My question is, when did the OOP constructs like private / protected / public etc actually come in to PHP. Was it with the first release of 5 or was it a later version i.e 5.1 or even 5.0.3 for example...?
Thanks in advance
I'm working on a site for a client who uses Lycos.co.uk for their webhosting. Lycos claims that they have PHP 5.0.2 installed on their servers, and to use PHP5 you just have to name your scripts with a .php5 extension.
I'm trying to run a class with protected and private vars, preset vars etc common to OOP in PHP5.
Code: Select all
class Foo{
protected $foo = 'bar';
private $bar = 'foo';
public function __construct(){
#do something
}
}My question is, when did the OOP constructs like private / protected / public etc actually come in to PHP. Was it with the first release of 5 or was it a later version i.e 5.1 or even 5.0.3 for example...?
Thanks in advance