3v4l.org

run code in 300+ PHP versions simultaneously
<?php // int isn't a reserved word, right? // So this should work fine! const int = 7; // Let's try using it! echo int; echo (int) 8.7; /* Wait, what? A parse error? Why, you might ask? (int) is a special case in the lexer. Turns out that casts are lexed specially. Why? Probably to stop the type names being reserved words. That worked out spectacularly, didn't it. This has been around since at least PHP 3. */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OPhti
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CONST                                            'int', 7
    8     1        FETCH_CONSTANT                                   ~0      'int'
          2        ECHO                                                     ~0
    9     3        CAST                                          4  ~1      8.7
          4        ECHO                                                     ~1
   17     5      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.58 ms | 1383 KiB | 13 Q