3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_data1 = array('one','two','three'); // all is ok $test_data2 = array(array('one','two','three')); // windows error: // #The instruction at '<address>' referenced memory at '<address>'. // #The memory could not be read. // #Click OK to terminate the program. // No error shows up in console, sometimes script stops without error but sometimes executes like nothing is happening. $test_data3 = array(array('one','two','three'),array('four','five','six')); // error in PHP console: // Fatal error: Call to a member function show_message() on a non-object in c:\scripts\found-error.php on line xx // values one two three are displayed, four five and six are ommitted. class myClass { function iterate_multidim_array($array) { array_walk_recursive($array,function(&$val,$key,&$obj) { $obj->show_message($val); },$this); } function show_message($msg) { echo $msg."\n"; } } $myInstance = new MyClass(); $myInstance-> iterate_multidim_array($test_data3); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 one Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 two Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 three Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 four Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 five Warning: myClass::{closure}(): Argument #3 ($obj) must be passed by reference, value given in /in/B8FU9 on line 20 six

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.83 ms | 402 KiB | 8 Q