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 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.22 - 5.3.29, 5.4.12 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty needle in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty needle in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty needle in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty needle in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: Empty delimiter in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )
Output for 5.2.5 - 5.3.21, 5.4.0 - 5.4.11
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )
Output for 5.0.4 - 5.2.4
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos(): Empty delimiter. in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos() [http://www.php.net/function.strpos]: Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos() [http://www.php.net/function.strpos]: Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos() [http://www.php.net/function.strpos]: Empty delimiter. in /in/BKHbQ on line 15 Notice: Undefined variable: str in /in/BKHbQ on line 15 Warning: strpos() [http://www.php.net/function.strpos]: Empty delimiter. in /in/BKHbQ on line 15 Array ( ) <br/>Array ( )