3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ (object) ["email" => "gffggfg"], (object) ["email" => "wefwef@test.it"], (object) ["email" => "wefewf"], ]; $array2 = [ (object) ["email" => "gffggfg@test.it"], (object) ["email" => "wefwef"], (object) ["email" => "wefewf"], ]; function concatArrays($arrays){ $buf = []; foreach($arrays as $arr){ foreach($arr as $v){ $buf[$v] = true; } } return array_keys($buf); } var_export( concatArrays([$array1, $array2]) );
Output for git.master, git.master_jit
Fatal error: Uncaught TypeError: Illegal offset type in /in/dp6tt:18 Stack trace: #0 /in/dp6tt(25): concatArrays(Array) #1 {main} thrown in /in/dp6tt on line 18
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught TypeError: Cannot access offset of type object on array in /in/dp6tt:18 Stack trace: #0 /in/dp6tt(25): concatArrays(Array) #1 {main} thrown in /in/dp6tt on line 18
Process exited with code 255.

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:
112.54 ms | 406 KiB | 5 Q