3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONST_VALUE = 'A constant value'; } $classname = 'MyClass'; echo $classname::CONST_VALUE; // As of PHP 5.3.0 echo MyClass::CONST_VALUE; class OtherClass extends MyClass { public static $my_static = 'static var'; public static function doubleColon() { echo parent::CONST_VALUE . "\n"; echo self::$my_static . "\n"; } } $classname = 'OtherClass'; echo $classname::doubleColon(); // As of PHP 5.3.0 OtherClass::doubleColon(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Bfc8
function name:  (null)
number of ops:  13
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'MyClass'
    9     1        FETCH_CLASS                                   0  $2      !0
          2        FETCH_CLASS_CONSTANT                             ~3      $2, 'CONST_VALUE'
          3        ECHO                                                     ~3
   11     4        ECHO                                                     'A+constant+value'
   22     5        ASSIGN                                                   !0, 'OtherClass'
   23     6        FETCH_CLASS                                   0  $5      !0
          7        INIT_STATIC_METHOD_CALL                                  $5, 'doubleColon'
          8        DO_FCALL                                      0  $6      
          9        ECHO                                                     $6
   25    10        INIT_STATIC_METHOD_CALL                                  'OtherClass', 'doubleColon'
         11        DO_FCALL                                      0          
   27    12      > RETURN                                                   1

Class MyClass: [no user functions]
Class OtherClass:
Function doublecolon:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Bfc8
function name:  doubleColon
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_CLASS_CONSTANT                             ~0      'CONST_VALUE'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   18     3        FETCH_STATIC_PROP_R          unknown             ~2      'my_static'
          4        CONCAT                                           ~3      ~2, '%0A'
          5        ECHO                                                     ~3
   19     6      > RETURN                                                   null

End of function doublecolon

End of class OtherClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.53 ms | 1398 KiB | 13 Q