3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public const BAR = BAZ; } try { new Foo(); } catch (Throwable $e) { echo (string) $e . "\n"; } define('BAZ', 'BAZ'); new Foo(); var_dump(Foo::BAR);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghG5d
function name:  (null)
number of ops:  20
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        FREE                                                         $1
          3      > JMP                                                          ->8
    9     4  E > > CATCH                                           last         'Throwable'
   10     5    >   CAST                                              6  ~3      !0
          6        CONCAT                                               ~4      ~3, '%0A'
          7        ECHO                                                         ~4
   13     8    >   INIT_FCALL                                                   'define'
          9        SEND_VAL                                                     'BAZ'
         10        SEND_VAL                                                     'BAZ'
         11        DO_ICALL                                                     
   14    12        NEW                                                  $6      'Foo'
         13        DO_FCALL                                          0          
         14        FREE                                                         $6
   15    15        INIT_FCALL                                                   'var_dump'
         16        FETCH_CLASS_CONSTANT                                 ~8      'Foo', 'BAR'
         17        SEND_VAL                                                     ~8
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.34 ms | 478 KiB | 9 Q