3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private const STUFF = 'yay'; public function doSomething() { var_dump(static::STUFF); } } class B extends A {} (new A())->doSomething(); (new B())->doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDU2P
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'doSomething'
          3        DO_FCALL                                      0          
   15     4        NEW                                              $3      'B'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $3, 'doSomething'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class A:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDU2P
function name:  doSomething
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_CONSTANT                             ~0      'STUFF'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function dosomething

End of class A.

Class B:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDU2P
function name:  doSomething
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_CONSTANT                             ~0      'STUFF'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function dosomething

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.78 ms | 1000 KiB | 14 Q