Edit report at http://pear.php.net/bugs/bug.php?id=17352&edit=1
ID: 17352
Updated by: daniel.oconnor@gmail.com
Reported By: yoshin-t at jp dot fujitsu dot com
Summary: PHP Deprecated: Function split() is deprecated
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: HTML_Select
Operating System: FreeBSD 8.0
Package Version: 1.3.0
PHP Version: 5.3.2
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:
-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.
Previous Comments:
------------------------------------------------------------------------
[2010-04-28 10:30:26] yt20100428
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)
------------------------------------------------------------------------