3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TypedInt { public static int $intVar = 0; } $intVar = &TypedInt::$intVar; echo $intVar; // 0 $intVar = 3; echo $intVar; // 3 $intVar = 'x'; // Fatal error: Uncaught TypeError
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GFNgp
function name:  (null)
number of ops:  7
compiled vars:  !0 = $intVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_STATIC_PROP_W          unknown             $1      'intVar'
          1        ASSIGN_REF                                               !0, $1
    8     2        ECHO                                                     !0
   10     3        ASSIGN                                                   !0, 3
   11     4        ECHO                                                     !0
   13     5        ASSIGN                                                   !0, 'x'
          6      > RETURN                                                   1

Class TypedInt: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.71 ms | 1396 KiB | 13 Q