3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(); $obj = new stdClass(); function foo( $foo ) { $foo[0]['key'] = 'value'; $foo[1]->key = 'value'; } foo( array( &$array, $obj ) ); var_dump( $array ); var_dump( $obj );

preferences:
57.32 ms | 404 KiB | 5 Q