3v4l.org

run code in 300+ PHP versions simultaneously
<?php $browser_list = ["test"]; $template_directory = "test"; function getTemplateProperties() { global $browser_list; global $template_directory; $data = '{ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }'; $json_data = json_decode(file_get_contents($data), true); $browser_list=$json_data["data"]["browsers"]; print_r($browser_list); $template_directory=$json_data["data"]["template_folder"]; print_r($template_directory); } getTemplateProperties(); print_r( $browser_list); // outputs 15 echo $template_directory; ?>
Output for git.master, git.master_jit
Warning: file_get_contents(): open_basedir restriction in effect. File({ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Lhgmf on line 9 Warning: file_get_contents({ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }): Failed to open stream: Operation not permitted in /in/Lhgmf on line 9 Warning: Trying to access array offset on value of type null in /in/Lhgmf on line 10 Warning: Trying to access array offset on value of type null in /in/Lhgmf on line 10 Warning: Trying to access array offset on value of type null in /in/Lhgmf on line 12 Warning: Trying to access array offset on value of type null in /in/Lhgmf on line 12
Output for rfc.property-hooks
Warning: file_get_contents(): open_basedir restriction in effect. File({ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Lhgmf on line 9 Warning: file_get_contents({ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }): Failed to open stream: Operation not permitted in /in/Lhgmf on line 9 Warning: Trying to access array offset on null in /in/Lhgmf on line 10 Warning: Trying to access array offset on null in /in/Lhgmf on line 10 Warning: Trying to access array offset on null in /in/Lhgmf on line 12 Warning: Trying to access array offset on null in /in/Lhgmf on line 12

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