I tried to use this very useful library with php 5.3.2. Unfortunately, it is no more compatible with the latest versions of PHP (OK with 5.1.6, but not OK with 5.3.2, and I HAVE to use 5.3.2). The problem concerns the use of the reference for the functions as well as the "=& new xxx".
There are 3 families of errors:
1. Deprecated: Assigning the return value of new by reference is deprecated
2. Fatal error: Call to undefined method polygon::boolean() in polyExample.php on line 157
3. Call to a member function id() on a non-object in polygon.php on line 217
Is it foreseen to port this library for the current versions of PHP ? If yes, any idea when ?
Great job from you up to now, it would be a pity to leave this library die...
Andreas Geesen - 2011-10-07 08:12:53 - In reply to message 1 from Jean-Remi Dunand
I have taken some time to investigate this issue. My solution is to make some replacements to all the files. Here's a list of replacements to be done. I'll try to update the code, too (don't know if i can here yet).
Syntax: 'Searchfor' => 'Replacewith'
Leave out the ' when searching & replacing, but keep spaces within intact.
'function &' => function '
' =& ' => ' = '
I do understand, that Brenor wanted to keep memory footprint of his classes low by using pointers a lot, but with PHP 5.3 new instances of a class are automatically pointered and a lot of object references turn to pointers on references and loose their object character. My search&replace is like hitting with a hammer surely hitting some occurences not neccessarily to be modified, but all my tests worked fine.