3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function b() { echo static::class; } } class B extends A {} $r = new \ReflectionMethod('B', 'b'); var_dump($r->getClosureScopeClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hXBYu
function name:  (null)
number of ops:  11
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'ReflectionMethod'
          1        SEND_VAL_EX                                              'B'
          2        SEND_VAL_EX                                              'b'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   12     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getClosureScopeClass'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hXBYu
function name:  b
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_NAME                                 ~0      
          1        ECHO                                                     ~0
    6     2      > RETURN                                                   null

End of function b

End of class A.

Class B:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hXBYu
function name:  b
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_NAME                                 ~0      
          1        ECHO                                                     ~0
    6     2      > RETURN                                                   null

End of function b

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.3 ms | 1010 KiB | 14 Q