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

preferences:
36.56 ms | 402 KiB | 5 Q