3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tag {}; $setTags = []; function setTags(array $tags, &$setTags) { array_map( function (Tag $tag) { $setTags[] = $tag; }, $tags ); } var_dump($setTags); setTags( [ new Tag(), new Tag(), new Tag(), new Tag(), ], $setTags ); var_dump($setTags);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lbtbd
function name:  (null)
number of ops:  24
compiled vars:  !0 = $setTags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   16     4        INIT_FCALL                                               'settags'
   18     5        NEW                                              $3      'Tag'
          6        DO_FCALL                                      0          
          7        INIT_ARRAY                                       ~5      $3
   19     8        NEW                                              $6      'Tag'
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~5      $6
   20    11        NEW                                              $8      'Tag'
         12        DO_FCALL                                      0          
         13        ADD_ARRAY_ELEMENT                                ~5      $8
   21    14        NEW                                              $10     'Tag'
         15        DO_FCALL                                      0          
         16        ADD_ARRAY_ELEMENT                                ~5      $10
         17        SEND_VAL                                                 ~5
   23    18        SEND_REF                                                 !0
         19        DO_FCALL                                      0          
   25    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function settags:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lbtbd
function name:  setTags
number of ops:  8
compiled vars:  !0 = $tags, !1 = $setTags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'array_map'
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Flbtbd%3A7%240'
   10     4        SEND_VAL                                                 ~2
   11     5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   13     7      > RETURN                                                   null

End of function settags

Function %00%7Bclosure%7D%2Fin%2Flbtbd%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lbtbd
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $tag, !1 = $setTags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_DIM                                               !1
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Flbtbd%3A7%240

Class Tag: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.36 ms | 1403 KiB | 18 Q