3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ (object) [ 'trainerid' => 1, 'firstname' => 'abc', 'location' => 'area', 'photo' => 'abc.jpg', 'role' => 'user', 'city' => 'bangalore', ], (object) [ 'trainerid' => 2, 'firstname' => 'abcd', 'location' => 'area', 'photo' => 'abcd.jpg', 'role' => 'user', 'city' => 'bangalore', ], ]; $array2 = [ (object) [ 'rating' => 3.0000, 'users' => 0, 'review' => 0 ], (object) [ 'rating' => 4.0000, 'users' => 4, 'review' => 5 ] ]; var_export( array_map( fn(...$objs) => (object) array_merge(...array_map('get_object_vars', $objs)), $array1, $array2 ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => (object) array( 'trainerid' => 1, 'firstname' => 'abc', 'location' => 'area', 'photo' => 'abc.jpg', 'role' => 'user', 'city' => 'bangalore', 'rating' => 3.0, 'users' => 0, 'review' => 0, ), 1 => (object) array( 'trainerid' => 2, 'firstname' => 'abcd', 'location' => 'area', 'photo' => 'abcd.jpg', 'role' => 'user', 'city' => 'bangalore', 'rating' => 4.0, 'users' => 4, 'review' => 5, ), )

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:
89.83 ms | 407 KiB | 5 Q