3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //Enter your code here, enjoy! $array = array(); $array[] = "usernaam1"; $array[] = "usernaam2"; $array[] = "usernaam3"; $array[] = "usernaam4"; foreach( $array as $key => $usernaam ){ $get_transient = TRUE; if ( false === $get_transient ) { // It isn't there, so do something. echo sprintf( "Fetching data for %s\n", $usernaam ); $array = array( "0" => $usernaam ); break; } echo sprintf( "Doing nothing for %s\n", $usernaam ); echo $key."\t=>\t".$value."\n"; } //var_dump($array);
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Doing nothing for usernaam1 Notice: Undefined variable: value in /in/6ZXHY on line 23 0 => Doing nothing for usernaam2 Notice: Undefined variable: value in /in/6ZXHY on line 23 1 => Doing nothing for usernaam3 Notice: Undefined variable: value in /in/6ZXHY on line 23 2 => Doing nothing for usernaam4 Notice: Undefined variable: value in /in/6ZXHY on line 23 3 =>
Output for hhvm-3.10.0
Doing nothing for usernaam1 Notice: Undefined variable: value in /in/6ZXHY on line 44 0 => Doing nothing for usernaam2 Notice: Undefined variable: value in /in/6ZXHY on line 44 1 => Doing nothing for usernaam3 Notice: Undefined variable: value in /in/6ZXHY on line 44 2 => Doing nothing for usernaam4 Notice: Undefined variable: value in /in/6ZXHY on line 44 3 =>
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/6ZXHY on line 25
Process exited with code 255.
Output for 4.3.0 - 5.0.3
Doing nothing for usernaam1 Notice: Undefined variable: value in /in/6ZXHY on line 23 0 => Doing nothing for usernaam2 Notice: Undefined variable: value in /in/6ZXHY on line 23 1 => Doing nothing for usernaam3 Notice: Undefined variable: value in /in/6ZXHY on line 23 2 => Doing nothing for usernaam4 Notice: Undefined variable: value in /in/6ZXHY on line 23 3 =>