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

Request #17352 PHP Deprecated: Function split() is deprecated
Submitted: 2010-04-28 14:30 UTC
From: yt20100428 Assigned: doconnor
Status: Closed Package: HTML_Select (version 1.3.0)
PHP Version: 5.3.2 OS: FreeBSD 8.0
Roadmaps: (Not assigned)    
Subscription  


 [2010-04-28 14:30 UTC] yt20100428 (Yoshinori Tomita)
Description: ------------ % php sel.php PHP Deprecated: Function split() is deprecated in /usr/local/share/pear/HTML/Select.php on line 107 Test script: --------------- <?php require_once 'HTML/Select.php'; $a = new HTML_Select(); $a->setSelectedValues('N/A'); // just a sample code Expected result: ---------------- a patch --- Select.php.ORG 2010-04-28 17:35:34.000000000 +0900 +++ Select.php 2010-04-28 17:36:18.000000000 +0900 @@ -104,7 +104,7 @@ function setSelectedValues($values) { if (is_string($values)) { - $values = split("[ ]?,[ ]?", $values); + $values = preg_split("/[ ]?,[ ]?/", $values); } if (!is_array($values)) { $values = array($values); Actual result: -------------- % php sel.php (no deprecated message)

Comments

 [2011-06-22 06:19 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Cheers for the patch; I accidentally fixed this with Revision: 302955 Author: clockwerx Date: 9:57:44 AM, Wednesday, 1 September 2010 Message: WARNING: Function 'split' is deprecated, please use 'explode' or 'preg_split' instead in file ./HTML_Select/HTML/Select.php line 107 ---- Modified : /pear/packages/HTML_Select/trunk/HTML/Select.php and forgot to update this item.