3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONST_VALUE = 'A constant value.'; static $a = 'hi!'; static function test() { echo 'hello!'; } } // not mentioned in docs $new = new MyClass(); echo $new::CONST_VALUE; echo $new::$a; echo $new::test(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y98cL
function name:  (null)
number of ops:  14
compiled vars:  !0 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        FETCH_CLASS                                   0  $4      !0
          4        FETCH_CLASS_CONSTANT                             ~5      $4, 'CONST_VALUE'
          5        ECHO                                                     ~5
   13     6        FETCH_CLASS                                   0  $6      !0
          7        FETCH_STATIC_PROP_R          unknown             ~7      'a'
          8        ECHO                                                     ~7
   14     9        FETCH_CLASS                                   0  $8      !0
         10        INIT_STATIC_METHOD_CALL                                  $8, 'test'
         11        DO_FCALL                                      0  $9      
         12        ECHO                                                     $9
   15    13      > RETURN                                                   1

Class MyClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y98cL
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'hello%21'
    7     1      > RETURN                                                   null

End of function test

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.2 ms | 1398 KiB | 13 Q