3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new stdClass(); $foo->bar = '1'; $a = function() use ($foo) { echo $foo->bar; }; $a(); $foo->bar = 2; $a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ffpTl
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        ASSIGN_OBJ                                               !0, 'bar'
          4        OP_DATA                                                  '1'
    5     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FffpTl%3A5%240'
          6        BIND_LEXICAL                                             ~6, !0
          7        ASSIGN                                                   !1, ~6
    7     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
    9    10        ASSIGN_OBJ                                               !0, 'bar'
         11        OP_DATA                                                  2
   10    12        INIT_DYNAMIC_CALL                                        !1
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.85 ms | 1394 KiB | 13 Q