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') || empty(static::TEST_CONSTANT)) { throw new Exception("Please define TEST_CONSTANT!"); } } abstract protected function someFunction(); } class ChildClass extends ParentClass { 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/19qOJ
function name:  (null)
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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 = 47) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/19qOJ
function name:  __construct
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        SEND_VAL                                                 'static%3A%3ATEST_CONSTANT'
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPNZ_EX                                         ~1      ~1, ->8
          5    >   FETCH_CLASS_CONSTANT                             ~2      'TEST_CONSTANT'
          6        BOOL_NOT                                         ~3      ~2
          7        BOOL                                             ~1      ~3
          8    > > JMPZ                                                     ~1, ->13
    9     9    >   NEW                                              $4      'Exception'
         10        SEND_VAL_EX                                              'Please+define+TEST_CONSTANT%21'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $4
   11    13    > > 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/19qOJ
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/19qOJ
function name:  someFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   null

End of function somefunction

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

End of function __construct

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.57 ms | 1400 KiB | 15 Q