1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Files
archived-php-src/ext/standard/tests/general_functions/var_export_basic9.phpt
Andrea Faulds e4e9cd8355 Export stdClass objects using (object) cast (fixes #48016)
Before this change, var_export()'s output for stdClass objects calls
the non-existent stdClass::__set_state method, and is therefore useless.

This commit makes var_export() output an (object) cast from an array
instead, which when evaluated, will produce a stdClass object. Other
classes see unchanged output.
2018-07-12 13:22:26 +02:00

12 lines
192 B
PHP

--TEST--
Bug #55082: var_export() doesn't escape properties properly
--FILE--
<?php
$x = new stdClass();
$x->{'\'\\'} = 7;
echo var_export($x);
--EXPECT--
(object) array(
'\'\\' => 7,
)