3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $str in /in/BKHbQ on line 15 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /in/BKHbQ on line 15 Warning: Undefined variable $str in /in/BKHbQ on line 15 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /in/BKHbQ on line 15 Warning: Undefined variable $str in /in/BKHbQ on line 15 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /in/BKHbQ on line 15 Warning: Undefined variable $str in /in/BKHbQ on line 15 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /in/BKHbQ on line 15 Array ( [0] => 2 [1] => 4 [2] => 8 [3] => 20 ) <br/>Array ( [0] => Romero [1] => Ronaldinho [2] => ronaldo [3] => messi )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.89 ms | 403 KiB | 8 Q