3v4l.org

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

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

End of function test

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.2 ms | 1395 KiB | 15 Q