3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function my_other_function($d) { return $d; } function my_function($data) { foreach ($data as $info) { $new_info = my_other_function($info); $new_data[] = $new_info; } print_r($new_data); return $new_data; } $data = array('7245'); echo 'test1'; // prints out test1 $new_data = my_function($data); echo 'test2'; // prints out test2 print_r($new_data); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
test1Array ( [0] => 7245 ) test2Array ( [0] => 7245 )