3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass(); $a->id = 17; $a->res_id = 10; $a->cat_id = 3; $b = new stdClass(); $b->id = 18; $b->res_id = 10; $b->cat_id = 4; $c = new stdClass(); $c->id = 52; $c->res_id = 19; $c->cat_id = 1; $d = new stdClass(); $d->id = 53; $d->res_id = 19; $d->cat_id = 3; $e = new stdClass(); $e->id = 54; $e->res_id = 19; $e->cat_id = 4; $array = Array ( $a, $b, $c, $d, $e ); $result = array_map(function($x){ return $x->cat_id; }, $array); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUXSe
function name:  (null)
number of ops:  61
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $array, !6 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $7
    4     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  17
    5     5        ASSIGN_OBJ                                               !0, 'res_id'
          6        OP_DATA                                                  10
    6     7        ASSIGN_OBJ                                               !0, 'cat_id'
          8        OP_DATA                                                  3
    8     9        NEW                                              $13     'stdClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $13
    9    12        ASSIGN_OBJ                                               !1, 'id'
         13        OP_DATA                                                  18
   10    14        ASSIGN_OBJ                                               !1, 'res_id'
         15        OP_DATA                                                  10
   11    16        ASSIGN_OBJ                                               !1, 'cat_id'
         17        OP_DATA                                                  4
   13    18        NEW                                              $19     'stdClass'
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !2, $19
   14    21        ASSIGN_OBJ                                               !2, 'id'
         22        OP_DATA                                                  52
   15    23        ASSIGN_OBJ                                               !2, 'res_id'
         24        OP_DATA                                                  19
   16    25        ASSIGN_OBJ                                               !2, 'cat_id'
         26        OP_DATA                                                  1
   18    27        NEW                                              $25     'stdClass'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !3, $25
   19    30        ASSIGN_OBJ                                               !3, 'id'
         31        OP_DATA                                                  53
   20    32        ASSIGN_OBJ                                               !3, 'res_id'
         33        OP_DATA                                                  19
   21    34        ASSIGN_OBJ                                               !3, 'cat_id'
         35        OP_DATA                                                  3
   23    36        NEW                                              $31     'stdClass'
         37        DO_FCALL                                      0          
         38        ASSIGN                                                   !4, $31
   24    39        ASSIGN_OBJ                                               !4, 'id'
         40        OP_DATA                                                  54
   25    41        ASSIGN_OBJ                                               !4, 'res_id'
         42        OP_DATA                                                  19
   26    43        ASSIGN_OBJ                                               !4, 'cat_id'
         44        OP_DATA                                                  4
   30    45        INIT_ARRAY                                       ~37     !0
   31    46        ADD_ARRAY_ELEMENT                                ~37     !1
   32    47        ADD_ARRAY_ELEMENT                                ~37     !2
   33    48        ADD_ARRAY_ELEMENT                                ~37     !3
   34    49        ADD_ARRAY_ELEMENT                                ~37     !4
   28    50        ASSIGN                                                   !5, ~37
   37    51        INIT_FCALL                                               'array_map'
         52        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAUXSe%3A37%240'
   39    53        SEND_VAL                                                 ~39
         54        SEND_VAR                                                 !5
         55        DO_ICALL                                         $40     
   37    56        ASSIGN                                                   !6, $40
   41    57        INIT_FCALL                                               'print_r'
         58        SEND_VAR                                                 !6
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAUXSe%3A37%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUXSe
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   38     1        FETCH_OBJ_R                                      ~1      !0, 'cat_id'
          2      > RETURN                                                   ~1
   39     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAUXSe%3A37%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.93 ms | 1400 KiB | 17 Q