3v4l.org

run code in 500+ 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:  56
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        FRAMELESS_ICALL_2                class_exists        ~15     'TestClass', <true>
         25        SEND_VAL                                                     ~15
         26        DO_ICALL                                                     
   20    27        ECHO                                                         'Unregister+trampoline%3A%0A'
   21    28        INIT_FCALL                                                   'var_dump'
         29        INIT_FCALL                                                   'spl_autoload_unregister'
         30        SEND_VAR                                                     !1
         31        DO_ICALL                                             $17     
         32        SEND_VAR                                                     $17
         33        DO_ICALL                                                     
   22    34        INIT_FCALL                                                   'var_dump'
         35        INIT_FCALL                                                   'spl_autoload_unregister'
         36        SEND_VAR                                                     !1
         37        DO_ICALL                                             $19     
         38        SEND_VAR                                                     $19
         39        DO_ICALL                                                     
   23    40        INIT_FCALL                                                   'var_dump'
         41        INIT_FCALL                                                   'spl_autoload_unregister'
         42        SEND_VAR                                                     !2
         43        DO_ICALL                                             $21     
         44        SEND_VAR                                                     $21
         45        DO_ICALL                                                     
   25    46        INIT_FCALL                                                   'var_dump'
         47        INIT_FCALL                                                   'spl_autoload_functions'
         48        DO_ICALL                                             $23     
         49        SEND_VAR                                                     $23
         50        DO_ICALL                                                     
   26    51        INIT_FCALL                                                   'var_dump'
         52        FRAMELESS_ICALL_2                class_exists        ~25     'TestClass', <true>
         53        SEND_VAL                                                     ~25
         54        DO_ICALL                                                     
         55      > 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.5.0


preferences:
123.16 ms | 486 KiB | 11 Q