3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONSTANT = 'constant value'; function showConstant() { echo self::CONSTANT . "\n"; } } echo MyClass::CONSTANT . "\n"; $classname = "MyClass"; echo $classname::CONSTANT . "\n"; // As of PHP 5.3.0 $class = new MyClass(); $class->showConstant(); echo $class::CONSTANT."\n"; // As of PHP 5.3.0 ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcgJC
function name:  (null)
number of ops:  16
compiled vars:  !0 = $classname, !1 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'constant+value%0A'
   15     1        ASSIGN                                                   !0, 'MyClass'
   16     2        FETCH_CLASS                                   0  $3      !0
          3        FETCH_CLASS_CONSTANT                             ~4      $3, 'CONSTANT'
          4        CONCAT                                           ~5      ~4, '%0A'
          5        ECHO                                                     ~5
   18     6        NEW                                              $6      'MyClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   19     9        INIT_METHOD_CALL                                         !1, 'showConstant'
         10        DO_FCALL                                      0          
   21    11        FETCH_CLASS                                   0  $10     !1
         12        FETCH_CLASS_CONSTANT                             ~11     $10, 'CONSTANT'
         13        CONCAT                                           ~12     ~11, '%0A'
         14        ECHO                                                     ~12
   23    15      > RETURN                                                   1

Class MyClass:
Function showconstant:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcgJC
function name:  showConstant
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'constant+value%0A'
   10     1      > RETURN                                                   null

End of function showconstant

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.24 ms | 1394 KiB | 13 Q