Bug #74672 [NEW]: var_export does not export a parsable string representation of stdClass objects
| From: | php-bugs-2014-08 at dotancohen dot com | Date: | Tue, 30 May 2017 06:53:18 +0000 |
| Subject: | Bug #74672 [NEW]: var_export does not export a parsable string representation of stdClass objects | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209298@lists.php.net to get a copy of this message | ||
From: php-bugs-2014-08 at dotancohen dot com
Operating system: Linux melancholy 3.13.0-34-gener
PHP version: 7.1.5
Package: Class/Object related
Bug Type: Bug
Bug description:var_export does not export a parsable string representation of stdClass objects
Description:
------------
The order of elements in the array sorted by natsort() is not as
expected by the function's name and description.
Test script:
---------------
<?php
$a = array('13.59', '14.6', '14.19');
natsort($a);
var_dump($a);
$b = array('img0120.jpg','img0.png', 'img0012.png',
'img10.png',
'img2.png', 'img1.png', 'img3.png');
natsort($b);
var_dump($b);
Expected result:
----------------
array(3) {
[0]=>
string(5) "13.59"
[1]=>
string(5) "14.19"
[2]=>
string(4) "14.6"
}
array(7) {
[0]=>
string(8) "img0.png"
[1]=>
string(8) "img1.png"
[2]=>
string(8) "img2.png"
[3]=>
string(8) "img3.png"
[4]=>
string(9) "img10.png"
[5]=>
string(11) "img0012.png"
[6]=>
string(11) "img0120.jpg"
}
Actual result:
--------------
array(3) {
[0]=>
string(5) "13.59"
[1]=>
string(4) "14.6"
[2]=>
string(5) "14.19"
}
array(7) {
[1]=>
string(8) "img0.png"
[2]=>
string(11) "img0012.png"
[0]=>
string(11) "img0120.jpg"
[5]=>
string(8) "img1.png"
[4]=>
string(8) "img2.png"
[6]=>
string(8) "img3.png"
[3]=>
string(9) "img10.png"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=74672&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74672&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74672&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74672&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74672&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74672&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74672&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74672&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74672&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74672&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74672&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74672&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74672&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74672&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74672&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74672&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74672&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74672&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74672&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74672&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74672&r=mysqlcfg