3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = (object) array( 'errors' => array( 'up-to-date' => 'foo' ) ); var_dump( $result ); var_dump( reset( reset( $result ) ) );
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(stdClass)#1 (1) { ["errors"]=> array(1) { ["up-to-date"]=> string(3) "foo" } } Deprecated: reset(): Calling reset() on an object is deprecated in /in/aRcq2 on line 5 Notice: Only variables should be passed by reference in /in/aRcq2 on line 5 string(3) "foo"
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
object(stdClass)#1 (1) { ["errors"]=> array(1) { ["up-to-date"]=> string(3) "foo" } } Notice: Only variables should be passed by reference in /in/aRcq2 on line 5 string(3) "foo"
Output for 7.3.32 - 7.3.33
object(stdClass)#1 (1) { ["errors"]=> array(1) { ["up-to-date"]=> string(3) "foo" } } string(3) "foo"
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
object(stdClass)#1 (1) { ["errors"]=> array(1) { ["up-to-date"]=> string(3) "foo" } } Strict Standards: Only variables should be passed by reference in /in/aRcq2 on line 5 string(3) "foo"

preferences:
176.43 ms | 402 KiB | 226 Q