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 FFMG on 11/19/07 12:17

Toby A Inkster;104244 Wrote:
>
> If you really need to write code that is supported in both PHP 4 and
> 5,
> then just use PHP-4-style constructors, as they are supported just
> fine
> in PHP 5.
>
> However, given PHP 4's imminent demise, I can't see much point in
> supporting it much longer. Better to support 5+6 rather than 4+5.
>

In this case my idea was to partly understand why the two results were
different.

As for keeping php4+php5, it is one of the steps I am doing to move to
php5.

As you might know, upgrading the code is not that easy and making the
code backward compatible does allow me to test on php4 to make sure the
output/tests are still valid and as expected.
Because I know what output is expected in php4.

I can then run the same tests on php5 knowing that the logic is still
sound.
In other words, if my tests fail on php5 I will know that it is because
of a change in behavior in php and not because I forgot some obscure
line of code somewhere.

In my 'real' code, once the php5 code is running properly and has
passed some tests I will go around and remove all the unneeded php4
code, (and then retest to make sure that I did not remove to much).

I will then upgrade to php6 but in that case support both for the
foreseeable future.

I hope that made sense.

But I am still curious as to why the output is not the same in my
original post.

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=22378

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

 

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация