3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object) ['id' => 1, 'name' => 'hovno'], (object) ['id' => 2, 'name' => 'piča'], ]; $test = array_walk($array, function($item) { return $item->id; }); var_dump($test); echo implode(',', $test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8S1qD
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
    5     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    3     4        ASSIGN                                                   !0, ~3
    9     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8S1qD%3A9%240'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
   11    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   13    14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        ECHO                                                     $10
         19      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F8S1qD%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.33 ms | 1399 KiB | 19 Q