Req #75639 [NEW]: string2array($str)
| From: | web at houhejie dot cn | Date: | Wed, 06 Dec 2017 11:29:16 +0000 |
| Subject: | Req #75639 [NEW]: string2array($str) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212963@lists.php.net to get a copy of this message | ||
From: web at houhejie dot cn
Operating system:
PHP version: Next Major Version
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:string2array($str)
Description:
------------
---
From manual page: http://www.php.net/ref.strings
---
hope have a function string2array($str) to convert a arrayString to
Array, like:"[1,[2-1,2-2]]". we can't use the split() or explode(),
although the eval() can do it , but that's very dangerous for
uncontrolled data.
Test script:
---------------
$arr=string2array("[1,[2-1,2-2]]");
Expected result:
----------------
$arr=[1,[2-1,2-2]]
--
Edit bug report at https://bugs.php.net/bug.php?id=75639&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75639&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75639&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75639&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75639&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75639&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75639&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75639&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75639&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75639&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75639&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75639&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75639&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75639&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75639&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75639&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75639&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75639&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75639&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75639&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75639&r=mysqlcfg