3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo {private $a=1;} function test() { var_dump($this); } $object = new Foo; $closure = (new \ReflectionFunction('test'))->getClosure(); $closure = $closure->call($object);
based on YeDBj
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:  16
compiled vars:  !0 = $object, !1 = $closure
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   5     1        NOP                                                      
   8     2        NEW                                              $3      :-5
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $3
   9     5        NEW                                              $6      :-3
         6        SEND_VAL_EX                                              'test'
         7        DO_FCALL                                      0          
         8        INIT_METHOD_CALL                                         $6, 'getClosure'
         9        DO_FCALL                                      0  $8      
        10        ASSIGN                                                   !1, $8
  10    11        INIT_METHOD_CALL                                         !1, 'call'
        12        SEND_VAR_EX                                              !0
        13        DO_FCALL                                      0  $10     
        14        ASSIGN                                                   !1, $10
        15      > 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_VAR                                                 $0
         3        DO_ICALL                                                 
   7     4      > RETURN                                                   null

End of function test

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.3.0