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 ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z7jff
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
   13     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    3     4        ASSIGN                                                   !0, ~3
   24     5        CAST                                          8  ~6      <array>
          6        INIT_ARRAY                                       ~7      ~6
   29     7        CAST                                          8  ~8      <array>
          8        ADD_ARRAY_ELEMENT                                ~7      ~8
   22     9        ASSIGN                                                   !1, ~7
   35    10        INIT_FCALL                                               'var_export'
   36    11        INIT_FCALL                                               'array_map'
   37    12        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         13        SEND_VAL                                                 ~10
   38    14        SEND_VAR                                                 !0
   39    15        SEND_VAR                                                 !1
   36    16        DO_ICALL                                         $11     
   39    17        SEND_VAR                                                 $11
   35    18        DO_ICALL                                                 
   41    19      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z7jff
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $objs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV_VARIADIC                                    !0      
          1        INIT_FCALL                                               'array_merge'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'get_object_vars'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_UNPACK                                              $1
          7        CHECK_UNDEF_ARGS                                         
          8        DO_ICALL                                         $2      
          9        CAST                                          8  ~3      $2
         10      > RETURN                                                   ~3
         11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.88 ms | 1005 KiB | 16 Q