3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sessionArray = array( 'Romero' => 2, 'Ronaldinho' => 4, 'ronaldo' =>8, 'messi' => 20 ); $id = array(); $name = array(); foreach($sessionArray['list'] as $key => $value) { if(strpos(strtolower($key), strtolower($str)) !== FALSE) { $id[] = $value; $name[] = $key; } } print_r($id); echo "<br/>"; print_r($name);
Output for 5.3.0 - 7.1.0
Notice: Undefined index: list in /in/H2miD on line 13 Warning: Invalid argument supplied for foreach() in /in/H2miD on line 13 Array ( ) <br/>Array ( )
Output for 5.2.1 - 5.2.17
Notice: Undefined index: list in /in/H2miD on line 13 Warning: Invalid argument supplied for foreach() in /in/H2miD on line 13 Array ( ) <br/>Array ( )
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.2.0
Warning: Invalid argument supplied for foreach() in /in/H2miD on line 13 Array ( ) <br/>Array ( )
Output for 4.3.11
Array ( ) <br/>Array ( )