3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected function bar($name) { echo sprintf('Hello world! My name is %s', $name); } } $foo = new Foo(); $method = new \ReflectionMethod('Foo', 'bar'); $method->setAccessible(TRUE); $method->invoke($foo, 'Bart');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bk61m
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo, !1 = $method
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      'ReflectionMethod'
          4        SEND_VAL_EX                                              'Foo'
          5        SEND_VAL_EX                                              'bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   10     8        INIT_METHOD_CALL                                         !1, 'setAccessible'
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
   11    11        INIT_METHOD_CALL                                         !1, 'invoke'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAL_EX                                              'Bart'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bk61m
function name:  bar
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 'Hello+world%21+My+name+is+%25s'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        ECHO                                                     $1
    6     6      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1395 KiB | 15 Q