Re: class from php3 does not work in php4???

From: Date: Wed, 30 Aug 2000 13:55:20 +0000
Subject: Re: class from php3 does not work in php4???
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-14395@lists.php.net to get a copy of this message
On Wed, Aug 30, 2000 at 03:50:38PM +0200, Steven Glogger wrote: > no..this won't work :-( > i think he has problems with the 'var' statement... is this possible? please move the initialisation of you variables into the constructor of the class (one of the few incompatible changes PHP 3<->4). in PHP 3: class test { var $a = 1; } same in PHP 4: class test { var $a; function test() { // constructor $a = 1; } } tc > > greetings > > steven > > -----Ursprüngliche Nachricht----- > Von: Maxim Maletsky [mailto:maxim.maletsky@lincmedia.co.jp] > Gesendet: Mittwoch, 30. August 2000 12:29 > An: 'Steven Glogger' > Cc: PHP General List. (E-mail) > Betreff: RE: [PHP] class from php3 does not work in php4??? > > > I'm not sure why is that but my feeling says that the line > > var $port = 1111; > > should be > > var $port = "1111"; > > Try this... > > -----Original Message----- > From: Steven Glogger [mailto:list@glogger.ch] > Sent: Wednesday, August 30, 2000 6:37 PM > To: php-general@lists.php.net > Subject: [PHP] class from php3 does not work in php4??? > > > i have a class in php3 which works really good. but if i copy this class to > a php4 server, i get always an 'parse error' pointing to the lines starting > with 'var'. does var is inexistent in php4? or how is it now declarable? > > class cyrus_email_admin { > > var $host = "10.0.0.1"; > var $port = 1111; > var $user = ""; > var $admin_user = "admin"; > var $admin_pass = "12345"; > var $socket = 0; > var $error_msg = ""; > var $error = 0; > > .... > .... > } > > greetings > > steven > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.general (#14395) next »