3v4l.org

run code in 300+ PHP versions simultaneously
<?php // passing by reference function computeValue( &$param ){ // Something goes here foreach( $param as $k => $value){ $param[$k] = $value + 1; } } $x = array(); for( $i =0; $i<99; $i++){ $x[$i] = $i; } computeValue( $x); // array with 100 elements each incremented by 1 print_r( $x ); ?>

preferences:
38.49 ms | 402 KiB | 5 Q