Saturday, January 29, 2011

Image_GraphViz Not Compatible With PHP 5.3.x

I have a problem with Image_GraphViz PEAR package. I installed it on my computer and i tried the example, but it doesn't work on PHP 5.3.5. Instead, i got this following error messages:

Strict Standards: Non-static method System::mktemp() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Image/GraphViz.php on line 1005

Strict Standards: Non-static method System::_parseArgs() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 385

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 386

Strict Standards: Non-static method System::tmpdir() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 400

Strict Standards: Non-static method System::mkDir() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 403

Strict Standards: Non-static method System::_parseArgs() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 239

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 162

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 167

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 240

Strict Standards: Non-static method PEAR::registerShutdownFunc() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 421

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Image/GraphViz.php on line 204

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method System::_removeTmpFiles() should not be called statically in /usr/share/pear/PEAR.php on line 774

Strict Standards: Non-static method System::rm() should not be called statically in /usr/share/pear/System.php on line 440

Strict Standards: Non-static method System::_parseArgs() should not be called statically in /usr/share/pear/System.php on line 193

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/pear/Console/Getopt.php on line 166

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/Console/Getopt.php on line 167

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/System.php on line 194

Strict Standards: Non-static method System::_multipleToStruct() should not be called statically in /usr/share/pear/System.php on line 204

The example source code is very simple. Here they are:

<?php
require_once 'Image/GraphViz.php';
$gv = new Image_GraphViz();
$gv->addEdge(array('wake up' => 'visit bathroom'));
$gv->addEdge(array('visit bathroom' => 'make coffee'));
$gv->image();
?>

I tried to debug this code and i found out that the last line that caused the problem to appear which i think it's related to strictness of PHP 5.3.x compared to earlier version of PHP. I am thinking about compatibility issues between Image_GraphViz and PHP 5.3.x. I hope it can be solved as soon as possible