3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { const TEST = false; public function test() { var_dump($this, static::TEST, self::TEST); } } class B extends A { const TEST = true; public function test() { A::test(); parent::test(); } } $b = new B; $b->test();
based on 0kJiI
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/N2Qi8
function name:  (null)
number of ops:  9
compiled vars:  !0 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  12     1        NOP                                                      
         2        NOP                                                      
  22     3        NEW                                              $4      :-3
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  23     6        INIT_METHOD_CALL                                         !0, 'test'
         7        DO_FCALL                                      0          
         8      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/N2Qi8
function name:  test
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   INIT_FCALL                                               'var_dump'
         1        FETCH_THIS                                       $0      
         2        SEND_VAR                                                 $0
         3        FETCH_CLASS_CONSTANT                             ~1      'TEST'
         4        SEND_VAL                                                 ~1
         5        SEND_VAL                                                 <false>
         6        DO_ICALL                                                 
   9     7      > RETURN                                                   null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/N2Qi8
function name:  test
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  17     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
         1        DO_FCALL                                      0          
  18     2        INIT_STATIC_METHOD_CALL                                  'test'
         3        DO_FCALL                                      0          
  19     4      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 7.3.0