Login   Register  
PHP Classes
elePHPant
Icontem

incompatibility with latest versions of PHP

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Polygon  >  All threads  >  incompatibility with latest versions of PHP  >  (Un) Subscribe thread alerts  
Subject:incompatibility with latest versions of PHP
Summary:php scripts are no more compatible with latest versions of PHP
Messages:2
Author:Jean-Remi Dunand
Date:2011-05-13 10:17:10
Update:2011-10-07 08:12:53
 

  1. incompatibility with latest versions of PHP   Reply   Report abuse  
Picture of Jean-Remi Dunand
Jean-Remi Dunand
2011-05-13 10:17:10
Hi,

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...

Thanks for your support.

  2. Re: incompatibility with latest versions of PHP   Reply   Report abuse  
Picture of Andreas Geesen
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.