3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { return $this; } $closure = (new ReflectionFunction('foo'))->getClosure()->bindTo(new stdClass(), null); var_dump($closure);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gsh4l
function name:  (null)
number of ops:  16
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'ReflectionFunction'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $1, 'getClosure'
          4        DO_FCALL                                      0  $3      
          5        INIT_METHOD_CALL                                         $3, 'bindTo'
          6        NEW                                              $4      'stdClass'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $4
          9        SEND_VAL_EX                                              null
         10        DO_FCALL                                      0  $6      
         11        ASSIGN                                                   !0, $6
    8    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gsh4l
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
    5     2*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1395 KiB | 15 Q