3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class a { public function b(&$name, $junk) { $name = strtolower($name).$junk; } } $arguments = ['Rasmus', 'junk']; $obj = new a; $reflectionMethod = new ReflectionMethod('a', 'b'); $closure = $reflectionMethod->getClosure($obj); $closure(...$arguments); echo $arguments[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LR9ci
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arguments, !1 = $obj, !2 = $reflectionMethod, !3 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
   11     3        ASSIGN                                                   !0, <array>
   12     4        NEW                                              $6      'a'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   13     7        NEW                                              $9      'ReflectionMethod'
          8        SEND_VAL_EX                                              'a'
          9        SEND_VAL_EX                                              'b'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
   14    12        INIT_METHOD_CALL                                         !2, 'getClosure'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !3, $12
   15    16        INIT_DYNAMIC_CALL                                        !3
         17        SEND_UNPACK                                              !0
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      1          
   16    20        FETCH_DIM_R                                      ~15     !0, 0
         21        ECHO                                                     ~15
         22      > RETURN                                                   1

Class a:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LR9ci
function name:  b
number of ops:  8
compiled vars:  !0 = $name, !1 = $junk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      $2, !1
          6        ASSIGN                                                   !0, ~3
    7     7      > RETURN                                                   null

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.5 ms | 1388 KiB | 17 Q