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/cXN4B
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%2FcXN4B%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%2FcXN4B%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXN4B
function name:  {closure}
number of ops:  14
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        CONCAT                                           ~3      $2, '%2F'
          4        ASSIGN                                                   !1, ~3
    7     5        INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 '%5C'
          7        SEND_VAL                                                 '%2F'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        CONCAT                                           ~6      !1, $5
         11        CONCAT                                           ~7      ~6, '.php'
         12        INCLUDE_OR_EVAL                                          ~7, REQUIRE
    8    13      > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.66 ms | 1396 KiB | 23 Q