3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static function bar($t) { var_dump ($t);} } $ref= (new ReflectionMethod('ReflectionMethod', 'invokeArgs'))->getClosure(new ReflectionMethod('Foo', 'bar')); $closure = $ref->bindTo(new ReflectionMethod('Foo', 'bar'), 'Foo'); $closure(null, [1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mbvOB
function name:  (null)
number of ops:  26
compiled vars:  !0 = $ref, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'ReflectionMethod'
          2        SEND_VAL_EX                                              'invokeArgs'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $2, 'getClosure'
          5        NEW                                              $4      'ReflectionMethod'
          6        SEND_VAL_EX                                              'Foo'
          7        SEND_VAL_EX                                              'bar'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $4
         10        DO_FCALL                                      0  $6      
         11        ASSIGN                                                   !0, $6
   10    12        INIT_METHOD_CALL                                         !0, 'bindTo'
         13        NEW                                              $8      'ReflectionMethod'
         14        SEND_VAL_EX                                              'Foo'
         15        SEND_VAL_EX                                              'bar'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $8
         18        SEND_VAL_EX                                              'Foo'
         19        DO_FCALL                                      0  $10     
         20        ASSIGN                                                   !1, $10
   11    21        INIT_DYNAMIC_CALL                                        !1
         22        SEND_VAL_EX                                              null
         23        SEND_VAL_EX                                              <array>
         24        DO_FCALL                                      0          
         25      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mbvOB
function name:  bar
number of ops:  5
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.35 ms | 1388 KiB | 15 Q