3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class a { public function b(&$name) { $name = strtolower($name); } } $name = 'Rasmus'; $obj = new a; $reflectionMethod = new ReflectionMethod('a', 'b'); $closure = $reflectionMethod->getClosure($obj); $closure($name); echo $name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E2q8N
function name:  (null)
number of ops:  21
compiled vars:  !0 = $name, !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, 'Rasmus'
   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_VAR_EX                                              !0
         18        DO_FCALL                                      0          
   16    19        ECHO                                                     !0
         20      > RETURN                                                   1

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

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.51 ms | 1395 KiB | 17 Q