3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ParentClass { const TEST_CONSTANT = null; public function __construct() { if (!defined(self::TEST_CONSTANT)) { throw new Exception("Please define TEST_CONSTANT!"); } } abstract protected function someFunction(); } class ChildClass extends ParentClass { const TEST_CONSTANT = "value"; protected function someFunction() { //some functionality here } } $x = new ChildClass();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pfgg9
function name:  (null)
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'ChildClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class ParentClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pfgg9
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        SEND_VAL                                                 null
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->9
    9     5    >   NEW                                              $2      'Exception'
          6        SEND_VAL_EX                                              'Please+define+TEST_CONSTANT%21'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $2
   11     9    > > RETURN                                                   null

End of function __construct

Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pfgg9
function name:  someFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function somefunction

End of class ParentClass.

Class ChildClass:
Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pfgg9
function name:  someFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   null

End of function somefunction

Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pfgg9
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        SEND_VAL                                                 null
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->9
    9     5    >   NEW                                              $2      'Exception'
          6        SEND_VAL_EX                                              'Please+define+TEST_CONSTANT%21'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $2
   11     9    > > RETURN                                                   null

End of function __construct

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.44 ms | 1400 KiB | 15 Q