mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
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.
12 lines
192 B
PHP
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,
|
|
)
|