PHP Performance 5.1 / 5.2

Soldato
Joined
13 Feb 2003
Posts
4,353
Location
Over the Moon
Hey guys, does anybody know if there should be a dramatic drop in performance between using PHP 5.1 and 5.2?

We are currently using PHP4 at work and we are migrating to PHP5 and in our tests PHP5.2 seems to be quite a bit slower, unless there is something that we are not aware of?

Any help is appreciated.
 
Have you updated your code to reflect the new syntax?

I believe 5.2 is more strict than 5.1, in the sense that more code which is php4, generates errors on php5.2, but didn't in 5.1.
 
We have optimised code in certain areas yes, but in some cases performance is quite poor.

As we are upgrading from PHP4 we wanted to make use of the latest possible version.

Just Googling certain scenarios and have come across a Zend Memory Manager (which we are using) but i'm not sure if Zend has been added to our test images.
 
I don't mean optimise, I mean change reflecting the new Syntax.

example:
Code:
var $property; // php4
public $property; // php5

function MyClass() // php4 constructor
public function __construct() // php5 constructor
 
Ah yes, we have done that as well for making variables public, as for functions I honestly don't know (not my part of the project).

Are there any other changes that need to be made?

The help is appreciated :)
 
php.net has the full details, but the ones to remember are the magic function names, and that objects are always passed by reference, so having
Code:
function MyFunc (&$obj)
is obsolete.
 
Will def check that out in the morning, there are probably one or two floating about in the code. Thanks dude :)
 
Back
Top Bottom