Forum Moderators: coopster

Message Too Old, No Replies

Php 5

Coding changes?

         

henry0

7:13 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My host will soon support 5
for PHP files ending as PHP5

any coding real difference between the 4 versions and the newer 5 to be aware of?

any place to learn more about

regards

Henry

wruk999

7:19 pm on May 7, 2004 (gmt 0)

10+ Year Member



PHP 5 ChangeLog
Version 5.0.0 Release Candidate 2
25-Apr-2004

[php.net...]

Full Details on all changes made to the php parser.

wruk999.

ergophobe

7:45 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think a better overview is the articles at

[zend.com...]

I believe that mostly it is upwardly compatible for most things. There are some differences, though, such as class objects being passed by reference rather than value. So in PHP5

function ($obj){}
function (&$obj) {}

are identical in functionality. This is no problem unless you have a script that depends on objects being passed by value, for example.

Also, I think some long-deprecated features may have been dropped. Don't trust me on this though!

Tom

ergophobe

7:48 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Better still - I just found this

[zend.com...]

haxored

10:24 pm on May 7, 2004 (gmt 0)

10+ Year Member



Yeah, it looks like you should only be concerned about compatability if you're using OOP. Other than that, I think you're safe.. Unless you're using the DOMXML extension -- I am.. Luckily I'm keeping the XML stuff in a class on its own, so I can change it once as soon as PHP5 rolls around. I may even drop the XML class altogether, thanks to simpleXML (ooo!)

henry0

10:43 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you all for your input
well I was right to be concerned!
a few days ago
I updated my templating system and CMS to be fully OOP
of course there are no rush to jump on 5
however I need to be ready

also I need to load PHP5 in my testing RH server

hmmm a few more headaches in sight :)

regards

Henry

ergophobe

11:00 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




well I was right to be concerned!
a few days ago
I updated my templating system and CMS to be fully OOP

No! There should be no problem as far as I know. It's only if you are doing some sort of weird trick that you will have a problem.

If you are using OOP as normal (pass by value), the only effect should be that your app will speed up and use less memory when run with the PHP5 engine (Zend 2 engine).

If you are passing by reference, nothing will really change except that the reference will get passed to handle which will get passed to the function (instead of just passing the reference).

If you are passing by value and using some trick that depends on passing by value, then I'm *not sure* what would happen, but I suspect it will still run fine since there is no mention of any OOP incompatibility. I was wrong about this based on reading I had doone when they first announced the problem of changing to pass-by-reference. I'm fairly certain they have come up with a solution in the internals that means that it won't break code that passes by reference (the original worry) or by value.

Tom

henry0

12:12 pm on May 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Tom
I have now a clear picture

Henry

henry0

3:02 pm on May 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



While looking around I found a great tutorial/article

[phpbuilder.com...]