3v4l.org

run code in 300+ PHP versions simultaneously
<?php $teste = new stdClass(); $teste->a = 1; $teste->b = 2; function test_func($input){ foreach( $input as $key => $value ){ $input->$key = $value++; var_dump($key, $value); } return $input; } test_func($teste); var_dump($teste);

preferences:
16.29 ms | 402 KiB | 5 Q