3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = <<<EOB trait my_trait { static \$static_var = null; protected \$protected_var = null; static function test(\$arg) { echo \$arg; } } EOB; function my_autoloader($class) { global $code; echo "autoloading $class\n"; eval($code); } spl_autoload_register('my_autoloader'); class try_it { use my_trait; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xv5fN
function name:  (null)
number of ops:  6
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'trait+my_trait+%7B%0A++static+%24static_var+%3D+null%3B%0A++protected+%24protected_var+%3D+null%3B%0A%0A++static+function+test%28%24arg%29+%7B+echo+%24arg%3B+%7D%0A%7D'
   17     1        INIT_FCALL                                               'spl_autoload_register'
          2        SEND_VAL                                                 'my_autoloader'
          3        DO_ICALL                                                 
   19     4        DECLARE_CLASS                                            'try_it'
   21     5      > RETURN                                                   1

Function my_autoloader:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xv5fN
function name:  my_autoloader
number of ops:  8
compiled vars:  !0 = $class, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        BIND_GLOBAL                                              !1, 'code'
   13     2        ROPE_INIT                                     3  ~3      'autoloading+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
   14     6        INCLUDE_OR_EVAL                                          !1, EVAL
   15     7      > RETURN                                                   null

End of function my_autoloader

Class try_it: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.49 ms | 1395 KiB | 15 Q