3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TrampolineTest { public function __call(string $name, array $arguments) { echo 'Trampoline for ', $name, PHP_EOL; } } $o = new TrampolineTest(); $callback1 = [$o, 'trampoline1']; $callback2 = [$o, 'trampoline2']; spl_autoload_register($callback1); spl_autoload_register($callback2); spl_autoload_register($callback1); // 2nd call ignored var_dump(spl_autoload_functions()); var_dump(class_exists("TestClass", true)); echo "Unregister trampoline:\n"; var_dump(spl_autoload_unregister($callback1)); var_dump(spl_autoload_unregister($callback1)); var_dump(spl_autoload_unregister($callback2)); var_dump(spl_autoload_functions()); var_dump(class_exists("TestClass", true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0mYUn
function name:  (null)
number of ops:  62
compiled vars:  !0 = $o, !1 = $callback1, !2 = $callback2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $3      'TrampolineTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    9     3        INIT_ARRAY                                       ~6      !0
          4        ADD_ARRAY_ELEMENT                                ~6      'trampoline1'
          5        ASSIGN                                                   !1, ~6
   10     6        INIT_ARRAY                                       ~8      !0
          7        ADD_ARRAY_ELEMENT                                ~8      'trampoline2'
          8        ASSIGN                                                   !2, ~8
   12     9        INIT_FCALL                                               'spl_autoload_register'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   13    12        INIT_FCALL                                               'spl_autoload_register'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   14    15        INIT_FCALL                                               'spl_autoload_register'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   16    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'spl_autoload_functions'
         20        DO_ICALL                                         $13     
         21        SEND_VAR                                                 $13
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'class_exists'
         25        SEND_VAL                                                 'TestClass'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $15     
         28        SEND_VAR                                                 $15
         29        DO_ICALL                                                 
   20    30        ECHO                                                     'Unregister+trampoline%3A%0A'
   21    31        INIT_FCALL                                               'var_dump'
         32        INIT_FCALL                                               'spl_autoload_unregister'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $17     
         35        SEND_VAR                                                 $17
         36        DO_ICALL                                                 
   22    37        INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'spl_autoload_unregister'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $19     
         41        SEND_VAR                                                 $19
         42        DO_ICALL                                                 
   23    43        INIT_FCALL                                               'var_dump'
         44        INIT_FCALL                                               'spl_autoload_unregister'
         45        SEND_VAR                                                 !2
         46        DO_ICALL                                         $21     
         47        SEND_VAR                                                 $21
         48        DO_ICALL                                                 
   25    49        INIT_FCALL                                               'var_dump'
         50        INIT_FCALL                                               'spl_autoload_functions'
         51        DO_ICALL                                         $23     
         52        SEND_VAR                                                 $23
         53        DO_ICALL                                                 
   26    54        INIT_FCALL                                               'var_dump'
         55        INIT_FCALL                                               'class_exists'
         56        SEND_VAL                                                 'TestClass'
         57        SEND_VAL                                                 <true>
         58        DO_ICALL                                         $25     
         59        SEND_VAR                                                 $25
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

Class TrampolineTest:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0mYUn
function name:  __call
number of ops:  6
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ECHO                                                     'Trampoline+for+'
          3        ECHO                                                     !0
          4        ECHO                                                     '%0A'
    6     5      > RETURN                                                   null

End of function __call

End of class TrampolineTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.6 ms | 1009 KiB | 18 Q