3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; $add = function($var) use (&$array) { $array[] = $var; }; $add('1'); $add(true); $add(123454); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rlvjd
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $add
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRlvjd%3A5%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !1, ~3
    9     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAL_EX                                              '1'
          6        DO_FCALL                                      0          
   10     7        INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAL_EX                                              <true>
          9        DO_FCALL                                      0          
   11    10        INIT_DYNAMIC_CALL                                        !1
         11        SEND_VAL_EX                                              123454
         12        DO_FCALL                                      0          
   13    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FRlvjd%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.73 ms | 1387 KiB | 15 Q