#9 Errors on PHP 5.3+

open
nobody
None
5
2014-02-07
2013-03-29
Anonymous
No

I've got this problems installing phpCallGraph on Windows XP / PHP 5.3, but they must happen on any system, so here's the patch.

1) phpcallgraph-0.8.0\lib\instantsvc\components\CodeAnalyzer\src\code_analyzer.php
524: split got deprecated in PHP 5.3
-$arr = split('#-#-#-#-#', $result);
+$arr = preg_split('!#-#-#-#-#!', $result);

2) phpcallgraph-0.8.0\phpcallgraph-0.8.0\lib\pear\PEAR.php
569: pointers to new got deprecated
-$a = &new $ec($code, $mode, $options, $userinfo);
+$a = new $ec($code, $mode, $options, $userinfo);
572: pointers to new got deprecated
-$a = &new $ec($message, $code, $mode, $options, $userinfo);
+$a = new $ec($message, $code, $mode, $options, $userinfo);

3) phpcallgraph-0.8.0\phpcallgraph-0.8.0\lib\pear\System.php
27: there's no 'Console/Getopt.php';
You should add sources from this package too.
Link supplied for someone who would like to fix their distributions: http://pear.php.net/package/Console_Getopt/download/

Discussion

  • Dave
    Dave
    2014-02-07

    Same error on ubuntu 12.04.3 (php 5.3.10).

    Easy fix for Pear errors: $sudo apt-get install php-pear
    Same fix as 1) above for split() -> preg_split()

    Surprisingly not getting pointer error. Have to investigate further.