Just started using PHP 5 and I'm getting lots of errors that using the ampersand (&) in creating new class instances is deprecated in PHP 5.
Wrong:
$instance = &new Class;
Right:
$instance = new Class;
Naturally I've tried to program correctly and so I've got lots of instances of the "wrong" version all over the place (funny how that works out). Simple enough to globally find/replace, but should I be concerned about running the non-ampersand ("Right" version) code on PHP 4? Most of my clients are still on PHP 4 servers (though about half will be upgrading when Pair Networks moves to PHP 5 - soon I hope). I want to make my code fully compatible with PHP 5, but a lot of it still has to work in PHP 4 for the time being.
I'm guessing it's no big deal. I'm not generating so many objects, or working on sites with so many visitors, that it's likely to slow down any servers. And I'm not aware of what any other pitfalls there may be. Anyone care to reassure me?
- Bob