3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ParentClass { const TEST_CONSTANT = null; public function __construct() { if (!defined(static::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/oZvUk
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 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oZvUk
function name:  __construct
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        FETCH_CLASS_CONSTANT                             ~0      'TEST_CONSTANT'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->10
    9     6    >   NEW                                              $3      'Exception'
          7        SEND_VAL_EX                                              'Please+define+TEST_CONSTANT%21'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $3
   11    10    > > 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/oZvUk
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/oZvUk
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 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oZvUk
function name:  __construct
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        FETCH_CLASS_CONSTANT                             ~0      'TEST_CONSTANT'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->10
    9     6    >   NEW                                              $3      'Exception'
          7        SEND_VAL_EX                                              'Please+define+TEST_CONSTANT%21'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $3
   11    10    > > RETURN                                                   null

End of function __construct

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.74 ms | 1403 KiB | 15 Q