You are here: Re: __contruct in php4 not same behavior as php5 « PHP Programming Language « IT news, forums, messages
Re: __contruct in php4 not same behavior as php5

Posted by Oliver Grδtz on 11/21/07 19:06

FFMG schrieb:
> I am slowly moving my code to php5.

Hurry up! http://gophp5.org/

> But I would like to make it backward compatible in case something bad
> happens, (and to make sure I understand what the changes are).
>
> function TestClass() // For php4
> {
> $this->__construct();
> }

Very. Bad. Idea. Do not touch the PHP4 style constructors until you
finally stop supporting PHP4 in your application. Plan on doing this
QUICKLY! PHP4 dies! You had three and a half years time to switch to PHP5...

You will see the reference vs. copy issue explained by Rik Wasmus
everywhere in your application. PHP5 defaults to giving you references
instead of copies and the once almost-always-needed & operators left
over from your PHP4 code will in fact lead to a higher memory
consumption than necessary under PHP5 caused by the details in the
memory management of the Zend Engine but besides that your programm will
still run fine.

OLLi

--
"I hit him with a shovel." "Is he conscious?" "Yes.." "Then hit him again."
[Alias 507]

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация