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 = json_encode($sameArray); $mySentence = preg_replace('/a/', 'b', $mySentence); $otherArray = json_decode($mySentence); } }

preferences:
39.85 ms | 402 KiB | 5 Q