mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01: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.
14 lines
218 B
PHP
14 lines
218 B
PHP
--TEST--
|
|
var_export() and objects with numeric indexes properties
|
|
--FILE--
|
|
<?php
|
|
$a = (object) array (1, 3, "foo" => "bar");
|
|
var_export($a);
|
|
?>
|
|
--EXPECT--
|
|
(object) array(
|
|
'0' => 1,
|
|
'1' => 3,
|
|
'foo' => 'bar',
|
|
)
|