3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents('/tmp/Foo.php', 'class foo {}'); spl_autoload_register(function ($class) { $base_dir = sys_get_temp_dir(); require $base_dir . str_replace('\\', '/', $class) . '.php'; }); $foo = new Foo(); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1j750
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_put_contents'
          1        SEND_VAL                                                 '%2Ftmp%2FFoo.php'
          2        SEND_VAL                                                 'class+foo+%7B%7D'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'spl_autoload_register'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1j750%3A5%240'
    8     6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   10     8        NEW                                              $4      'Foo'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $4
   11    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1j750%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1j750
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $class, !1 = $base_dir
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'sys_get_temp_dir'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !1, $2
    7     4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 '%5C'
          6        SEND_VAL                                                 '%2F'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      !1, $4
         10        CONCAT                                           ~6      ~5, '.php'
         11        INCLUDE_OR_EVAL                                          ~6, REQUIRE
    8    12      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1j750%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.53 ms | 1396 KiB | 23 Q