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($_SESSION['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 git.master, git.master_jit
Warning: Undefined global variable $_SESSION in /in/K66sE on line 13 Warning: Trying to access array offset on value of type null in /in/K66sE on line 13 Warning: foreach() argument must be of type array|object, null given in /in/K66sE on line 13 Array ( ) <br/>Array ( )
Output for rfc.property-hooks
Warning: Undefined global variable $_SESSION in /in/K66sE on line 13 Warning: Trying to access array offset on null in /in/K66sE on line 13 Warning: foreach() argument must be of type array|object, null given in /in/K66sE on line 13 Array ( ) <br/>Array ( )

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:
39.62 ms | 401 KiB | 8 Q