Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Bug #16446 Use of split() causes E_DEPRECATED warnings
Submitted: 2009-07-17 14:26 UTC
From: aharvey Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.2)
PHP Version: 5.3.0 OS: Irrelevant
Roadmaps: 1.4.3    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 46 - 32 = ?

 
 [2009-07-17 14:26 UTC] aharvey (Adam Harvey)
Description: ------------ There are a few places within PhpDocumentor where split() is used, which causes deprecation warnings in PHP 5.3 that clutter the output of PhpDocumentor. Two patches against SVN trunk will be forthcoming momentarily: one will deal with instances within the phpDocumentor codebase itself, while the other deals with instances within the included Smarty version — presumably this won't need to be applied and Smarty can be left to fix it themselves, but just in case it's needed, I'll include it anyway. In both cases, split() calls are replaced with either explode() or preg_split() calls as appropriate. Without these patches, 10 tests fail due to deprecation warnings. All tests succeed with these patches applied. Additionally, running the patched phpdoc against my own projects still results in correct documentation being generated. Test script: --------------- The actual result includes partial output from a phpdoc run over a project I'm currently working on. I've stripped out the irrelevant parts. Expected result: ---------------- PHP Version 5.3.1-dev phpDocumentor version 1.4.2 Parsing configuration file phpDocumentor.ini... (found in /usr/local/share/pear/data/PhpDocumentor/)... done Maximum memory usage set at 256M after considering php.ini... using tokenizer Parser (Further normal output omitted.) Actual result: -------------- PHP Version 5.3.1-dev phpDocumentor version 1.4.2 Parsing configuration file phpDocumentor.ini... (found in /usr/local/share/pear/data/PhpDocumentor/)... done Maximum memory usage set at 256M after considering php.ini... using tokenizer Parser Deprecated: Function split() is deprecated in /usr/local/share/pear/PhpDocumentor/phpDocumentor/Io.inc on line 456 Call Stack: 0.0004 324208 1. {main}() /usr/local/bin/phpdoc:0 0.0011 331952 2. require('/usr/local/share/pear/PhpDocumentor/phpDocumentor/phpdoc.inc') /usr/local/bin/phpdoc:40 0.1993 8758480 3. phpDocumentor_setup->createDocs() /usr/local/share/pear/PhpDocumentor/phpDocumentor/phpdoc.inc:65 0.2047 8762656 4. Io->getBase() /usr/local/share/pear/PhpDocumentor/phpDocumentor/Setup.inc.php:674 Deprecated: Function split() is deprecated in /usr/local/share/pear/PhpDocumentor/phpDocumentor/Io.inc on line 457 Call Stack: 0.0004 324208 1. {main}() /usr/local/bin/phpdoc:0 0.0011 331952 2. require('/usr/local/share/pear/PhpDocumentor/phpDocumentor/phpdoc.inc') /usr/local/bin/phpdoc:40 0.1993 8758480 3. phpDocumentor_setup->createDocs() /usr/local/share/pear/PhpDocumentor/phpDocumentor/phpdoc.inc:65 0.2047 8762656 4. Io->getBase() /usr/local/share/pear/PhpDocumentor/phpDocumentor/Setup.inc.php:674 (Another 30 or 40 deprecation warnings followed by normal output omitted. The PhpDocumentor run is ultimately successful.)

Comments

 [2009-07-17 14:26 UTC] aharvey (Adam Harvey)
The following patch has been added/updated: Patch Name: phpdocumentor-split-replacements Revision: 1247822802 URL: http://pear.php.net/bugs/patch-display.php?bug=16446&patch=phpdocumentor-split-replacements&revision=1247822802&display=1
 [2009-07-17 14:27 UTC] aharvey (Adam Harvey)
The following patch has been added/updated: Patch Name: phpdocumentor-smarty-split-replacements Revision: 1247822821 URL: http://pear.php.net/bugs/patch-display.php?bug=16446&patch=phpdocumentor-smarty-split-replacements&revision=1247822821&display=1
 [2009-07-18 13:54 UTC] doconnor (Daniel O'Connor)
-Assigned To: +Assigned To: ashnazg
 [2009-08-08 10:58 UTC] ashnazg (Chuck Burgess)
-Roadmap Versions: +Roadmap Versions: 1.4.3
Patched code worked fine on all PHP versions I tested (5.3.0, 5.2.10, 5.2.6, 5.1.6, 5.0.5, 4.4.9), and it does clear up the deprecation warnings regarding split() in 5.3.0.
 [2009-08-08 11:02 UTC] ashnazg (Chuck Burgess)
-Status: Assigned +Status: Closed
Committed to SVN... thanks for the patches, Adam.