3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myArrayContainer{ function myArrayFunction(){ return $myArray = array( "Name" => "John", "LastName" => "Smith", ); } } $myShitz = new myArrayContainer(); $myShit = $myShitz->myArrayFunction(); $myShitClass = new myArrayClass($myShit); class myArrayClass { function __construct($myArray){ echo ("Printing my Array as Recieved"); echo ("</br>"); print_r(array_values($myArray)); $myProcessClass = new myProcess($myArray); } } class myProcess { function __construct($sameArray){ $mySentence = serialize($sameArray); print_r($mySentence); $placements = array ("John" => "Jose", "Smith" => "Tobar"); preg_replace("/:(\w+)/e", $placements[$1], $mySentence); } }
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '1' (T_LNUMBER), expecting variable (T_VARIABLE) or '$' in /in/6IEkQ on line 36
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /in/6IEkQ on line 36
Process exited with code 255.

preferences:
198.47 ms | 1386 KiB | 65 Q