3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $a = ['item'=>['werwer'=>['tueiah'=>['auihi'=>'wieurh']]]; // $s = 'item.werwer.tueiah.auihi.wieurh'; $a = ['item'=>'werwer']; $s = 'item.werwer'; echo get($a, $s); // echo substr($s,0,strpos($s,'.'))."\n"; // echo substr($s,strpos($s,'.')+1)."\n"; function get($i, $c){ if(strpos($c,'.')){ $next = substr($s,0,strpos($s,'.')); $rem = substr($s,strpos($s,'.')+1); return get($i[$next], $rem); }else{ return $i[$c]; } }
Output for git.master, git.master_jit
Warning: Undefined variable $s in /in/mGdHK on line 13 Warning: Undefined variable $s in /in/mGdHK on line 13 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /in/mGdHK on line 13 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/mGdHK on line 13 Warning: Undefined variable $s in /in/mGdHK on line 14 Warning: Undefined variable $s in /in/mGdHK on line 14 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /in/mGdHK on line 14 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/mGdHK on line 14 Warning: Undefined array key "" in /in/mGdHK on line 15 Warning: Trying to access array offset on value of type null in /in/mGdHK on line 17
Output for rfc.property-hooks
Warning: Undefined variable $s in /in/mGdHK on line 13 Warning: Undefined variable $s in /in/mGdHK on line 13 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /in/mGdHK on line 13 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/mGdHK on line 13 Warning: Undefined variable $s in /in/mGdHK on line 14 Warning: Undefined variable $s in /in/mGdHK on line 14 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /in/mGdHK on line 14 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/mGdHK on line 14 Warning: Undefined array key "" in /in/mGdHK on line 15 Warning: Trying to access array offset on null in /in/mGdHK on line 17

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:
50.54 ms | 402 KiB | 8 Q