3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(version_compare(PHP_VERSION, '5.0') < 0) { die(); } class Concrete5_Helper_Date { const CONST1 = 'core1'; const CONST2 = 'core2'; public static function test1() { echo "test1.self: ", self::CONST1, ", ", self::CONST2, "\n"; echo "test1.static: ", static::CONST1, ", ", static::CONST2, "\n"; } } class DateHelper extends Concrete5_Helper_Date { const CONST2 = 'override2'; public static function test2() { echo "test2.self: ", self::CONST1, ", ", self::CONST2, "\n"; echo "test2.static: ", static::CONST1, ", ", static::CONST2, "\n"; } } DateHelper::test1(); DateHelper::test2();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmu67
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'version_compare'
          1        SEND_VAL                                                 '8.0.0'
          2        SEND_VAL                                                 '5.0'
          3        DO_ICALL                                         $0      
          4        IS_SMALLER                                               $0, 0
          5      > JMPZ                                                     ~1, ->7
    3     6    > > EXIT                                                     
   20     7    >   INIT_STATIC_METHOD_CALL                                  'DateHelper', 'test1'
          8        DO_FCALL                                      0          
   21     9        INIT_STATIC_METHOD_CALL                                  'DateHelper', 'test2'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Concrete5_Helper_Date:
Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmu67
function name:  test1
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'test1.self%3A+'
          1        ECHO                                                     'core1'
          2        ECHO                                                     '%2C+'
          3        ECHO                                                     'core2'
          4        ECHO                                                     '%0A'
   10     5        ECHO                                                     'test1.static%3A+'
          6        FETCH_CLASS_CONSTANT                             ~0      'CONST1'
          7        ECHO                                                     ~0
          8        ECHO                                                     '%2C+'
          9        FETCH_CLASS_CONSTANT                             ~1      'CONST2'
         10        ECHO                                                     ~1
         11        ECHO                                                     '%0A'
   11    12      > RETURN                                                   null

End of function test1

End of class Concrete5_Helper_Date.

Class DateHelper:
Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmu67
function name:  test2
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'test2.self%3A+'
          1        FETCH_CLASS_CONSTANT                             ~0      'CONST1'
          2        ECHO                                                     ~0
          3        ECHO                                                     '%2C+'
          4        ECHO                                                     'override2'
          5        ECHO                                                     '%0A'
   17     6        ECHO                                                     'test2.static%3A+'
          7        FETCH_CLASS_CONSTANT                             ~1      'CONST1'
          8        ECHO                                                     ~1
          9        ECHO                                                     '%2C+'
         10        FETCH_CLASS_CONSTANT                             ~2      'CONST2'
         11        ECHO                                                     ~2
         12        ECHO                                                     '%0A'
   18    13      > RETURN                                                   null

End of function test2

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xmu67
function name:  test1
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'test1.self%3A+'
          1        ECHO                                                     'core1'
          2        ECHO                                                     '%2C+'
          3        ECHO                                                     'core2'
          4        ECHO                                                     '%0A'
   10     5        ECHO                                                     'test1.static%3A+'
          6        FETCH_CLASS_CONSTANT                             ~0      'CONST1'
          7        ECHO                                                     ~0
          8        ECHO                                                     '%2C+'
          9        FETCH_CLASS_CONSTANT                             ~1      'CONST2'
         10        ECHO                                                     ~1
         11        ECHO                                                     '%0A'
   11    12      > RETURN                                                   null

End of function test1

End of class DateHelper.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.35 ms | 1392 KiB | 15 Q