3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function($c) { echo "autoloading $c\n"; eval("class $c { const BAR=42; }"); }); class A { const FOO = B::BAR; } echo "class defined but not yet evaluated\n"; echo A::FOO;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFsCj
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FtFsCj%3A3%240'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4        ECHO                                                     'class+defined+but+not+yet+evaluated%0A'
   11     5        FETCH_CLASS_CONSTANT                             ~2      'A', 'FOO'
          6        ECHO                                                     ~2
   12     7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FtFsCj%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFsCj
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        ROPE_INIT                                     3  ~2      'autoloading+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
          5        ROPE_INIT                                     3  ~5      'class+'
          6        ROPE_ADD                                      1  ~5      ~5, !0
          7        ROPE_END                                      2  ~4      ~5, '+%7B+const+BAR%3D42%3B+%7D'
          8        INCLUDE_OR_EVAL                                          ~4, EVAL
          9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FtFsCj%3A3%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.23 ms | 1395 KiB | 15 Q