3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { $closure = eval('return function ($__contextVariables__){unset($__contextVariables__);return function (){};};'); $closure = $closure->bindTo(new stdClass(), 'stdClass'); var_dump($closure()); } } (new Foo)->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VPGAF
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'bar'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VPGAF
function name:  bar
number of ops:  15
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INCLUDE_OR_EVAL                                  $1      'return+function+%28%24__contextVariables__%29%7Bunset%28%24__contextVariables__%29%3Breturn+function+%28%29%7B%7D%3B%7D%3B', EVAL
          1        ASSIGN                                                   !0, $1
    5     2        INIT_METHOD_CALL                                         !0, 'bindTo'
          3        NEW                                              $3      'stdClass'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        SEND_VAL_EX                                              'stdClass'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !0, $5
    6     9        INIT_FCALL                                               'var_dump'
         10        INIT_DYNAMIC_CALL                                        !0
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                                 
    7    14      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.57 ms | 1386 KiB | 15 Q