MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001551XdebugUsage problems (Wrong Results)public2018-05-16 12:052018-05-17 15:36
Reporteraperez 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version2.6.0 
Target VersionFixed in Version 
Summary0001551: Property with value null is not represented well
DescriptionAn object with property named null will be possible to see the data there but with bad values, the image attached you can see the null property name is converted to 5381 whilst the value is not be possible to be get.

According to use var_dump, json_encode/json_decode, serialize/unserialize the value is $ or null if you use a foreach. So the behaviour is correct. But i don't know if it is that we want.

Could you check the property will be able to see?
Steps To ReproduceCode to reproduce the issue

$object = (object) [
null => $array = [1,2,3],
0 => [ 'a', 'l', '3' ],
1=> [ 'p', 'h', ‘p', ‘ ‘, ‘r’, ‘o’, ‘c’, k’, ‘s’, ‘\0’ ],
'funcion' => function () use ($array) {
     echo 'Valor del array innacesible: ' ,var_export($array, true), PHP_EOL;
}
];
$array = null;
TagsNo tags attached.
Operating SystemWindows 10
PHP Version7.2.0-7.2.4
Attached Filespng file icon property-null-bad-behaviour.png [^] (4,252 bytes) 2018-05-16 12:05

- Relationships

-  Notes
(0004653)
aperez (reporter)
2018-05-16 12:09
edited on: 2018-05-17 15:36

Please take in account the steps code to reproduce the issue are bad, they should be simple quotes. Sorry i cannot edit the report.

A note is possible to be modified so i am going to write here the correct:

$object = (object) [
null => $array = [1,2,3],
0 => [ 'a', 'l', '3' ],
1=> [ 'p', 'h', 'p', ' ', 'r', 'o', 'c', 'k', 's', '\0' ],
'funcion' => function () use ($array) {
     echo 'Valor del array innacesible: ' ,var_export($array, true), PHP_EOL;
}
];
$array = null;

Thanks!


- Issue History
Date Modified Username Field Change
2018-05-16 12:05 aperez New Issue
2018-05-16 12:05 aperez File Added: property-null-bad-behaviour.png
2018-05-16 12:09 aperez Note Added: 0004653
2018-05-16 12:09 aperez Note Edited: 0004653 View Revisions
2018-05-17 15:36 aperez Note Edited: 0004653 View Revisions


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker