3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); spl_autoload_register(function (string $name): void { printf("autoload: %s\n", $name); switch ($name) { case 'C1': class C1 {} break; case 'C2': class C2 {} break; case 'C3': class C3 { public static function method() {} } break; case 'C4': class C4 { public const V = 1; } break; case 'C5': class C5 { public static $v; } break; case 'C6': class C6 {} break; case 'C7': class C7 {} break; case 'I1': interface I1 {} break; case 'I2': interface I2 { public const V = 1; } break; case 'I3': interface I3 {} break; case 'T1': trait T1 {} break; case 'T2': trait T2 {} break; case 'E1': enum E1: int { case V = 10; } break; case 'A1': #[Attribute] class A1 {} break; } }); final class Foo extends C1 implements I1 { use T1; } new C2; C3::method(); C4::V; C5::$v; I2::V; E1::V; // T9::V; トレイト名による定数参照でオートロードは動作するが、その後 Cannot access trait constant エラーになる new ReflectionClass(C6::class); (new ReflectionClass(Foo::class))->getAttributes('A1', ReflectionAttribute::IS_INSTANCEOF); spl_autoload_call(C7::class); unserialize('O:2:"C8":0:{}'); // クラス定義が無くてもエラーにはならない /* object(__PHP_Incomplete_Class)#2 (1) { ["__PHP_Incomplete_Class_Name"]=> string(2) "C6" } */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqWuo
function name:  (null)
number of ops:  36
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
   66     2        SEND_VAL                                                 ~0
    4     3        DO_ICALL                                                 
   68     4        DECLARE_CLASS                                            'foo', 'c1'
   73     5        NEW                                              $2      'C2'
          6        DO_FCALL                                      0          
          7        FREE                                                     $2
   74     8        INIT_STATIC_METHOD_CALL                                  'C3', 'method'
          9        DO_FCALL                                      0          
   75    10        FETCH_CLASS_CONSTANT                             ~5      'C4', 'V'
         11        FREE                                                     ~5
   76    12        FETCH_STATIC_PROP_R          unknown             ~6      'v'
         13        FREE                                                     ~6
   77    14        FETCH_CLASS_CONSTANT                             ~7      'I2', 'V'
         15        FREE                                                     ~7
   78    16        FETCH_CLASS_CONSTANT                             ~8      'E1', 'V'
         17        FREE                                                     ~8
   81    18        NEW                                              $9      'ReflectionClass'
         19        SEND_VAL_EX                                              'C6'
         20        DO_FCALL                                      0          
         21        FREE                                                     $9
   82    22        NEW                                              $11     'ReflectionClass'
         23        SEND_VAL_EX                                              'Foo'
         24        DO_FCALL                                      0          
         25        INIT_METHOD_CALL                                         $11, 'getAttributes'
         26        SEND_VAL_EX                                              'A1'
         27        SEND_VAL_EX                                              2
         28        DO_FCALL                                      0          
   84    29        INIT_FCALL                                               'spl_autoload_call'
         30        SEND_VAL                                                 'C7'
         31        DO_ICALL                                                 
   86    32        INIT_FCALL                                               'unserialize'
         33        SEND_VAL                                                 'O%3A2%3A%22C8%22%3A0%3A%7B%7D'
         34        DO_ICALL                                                 
   92    35      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
16 jumps found. (Code = 188) Position 1 = 35, Position 2 = 37, Position 3 = 39, Position 4 = 41, Position 5 = 43, Position 6 = 45, Position 7 = 47, Position 8 = 49, Position 9 = 51, Position 10 = 53, Position 11 = 55, Position 12 = 57, Position 13 = 59, Position 14 = 61, Position 15 = 63, Position 16 = 6
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 63
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 35
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 37
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 39
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 41
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 43
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 45
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 47
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 49
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 51
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 53
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 55
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 57
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 59
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 61
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 61
Branch analysis from position: 59
Branch analysis from position: 57
Branch analysis from position: 55
Branch analysis from position: 53
Branch analysis from position: 51
Branch analysis from position: 49
Branch analysis from position: 47
Branch analysis from position: 45
Branch analysis from position: 43
Branch analysis from position: 41
Branch analysis from position: 39
Branch analysis from position: 37
Branch analysis from position: 35
filename:       /in/mqWuo
function name:  {closure}
number of ops:  64
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 'autoload%3A+%25s%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5      > SWITCH_STRING                                            !0, [ 'C1':->35, 'C2':->37, 'C3':->39, 'C4':->41, 'C5':->43, 'C6':->45, 'C7':->47, 'I1':->49, 'I2':->51, 'I3':->53, 'T1':->55, 'T2':->57, 'E1':->59, 'A1':->61, ], ->63
    7     6    >   IS_EQUAL                                                 !0, 'C1'
          7      > JMPNZ                                                    ~2, ->35
   10     8    >   IS_EQUAL                                                 !0, 'C2'
          9      > JMPNZ                                                    ~2, ->37
   13    10    >   IS_EQUAL                                                 !0, 'C3'
         11      > JMPNZ                                                    ~2, ->39
   19    12    >   IS_EQUAL                                                 !0, 'C4'
         13      > JMPNZ                                                    ~2, ->41
   25    14    >   IS_EQUAL                                                 !0, 'C5'
         15      > JMPNZ                                                    ~2, ->43
   31    16    >   IS_EQUAL                                                 !0, 'C6'
         17      > JMPNZ                                                    ~2, ->45
   34    18    >   IS_EQUAL                                                 !0, 'C7'
         19      > JMPNZ                                                    ~2, ->47
   37    20    >   IS_EQUAL                                                 !0, 'I1'
         21      > JMPNZ                                                    ~2, ->49
   40    22    >   IS_EQUAL                                                 !0, 'I2'
         23      > JMPNZ                                                    ~2, ->51
   46    24    >   IS_EQUAL                                                 !0, 'I3'
         25      > JMPNZ                                                    ~2, ->53
   49    26    >   IS_EQUAL                                                 !0, 'T1'
         27      > JMPNZ                                                    ~2, ->55
   52    28    >   IS_EQUAL                                                 !0, 'T2'
         29      > JMPNZ                                                    ~2, ->57
   55    30    >   IS_EQUAL                                                 !0, 'E1'
         31      > JMPNZ                                                    ~2, ->59
   61    32    >   IS_EQUAL                                                 !0, 'A1'
         33      > JMPNZ                                                    ~2, ->61
         34    > > JMP                                                      ->63
    8    35    >   DECLARE_CLASS                                            'c1'
    9    36      > JMP                                                      ->63
   11    37    >   DECLARE_CLASS                                            'c2'
   12    38      > JMP                                                      ->63
   14    39    >   DECLARE_CLASS                                            'c3'
   18    40      > JMP                                                      ->63
   20    41    >   DECLARE_CLASS                                            'c4'
   24    42      > JMP                                                      ->63
   26    43    >   DECLARE_CLASS                                            'c5'
   30    44      > JMP                                                      ->63
   32    45    >   DECLARE_CLASS                                            'c6'
   33    46      > JMP                                                      ->63
   35    47    >   DECLARE_CLASS                                            'c7'
   36    48      > JMP                                                      ->63
   38    49    >   DECLARE_CLASS                                            'i1'
   39    50      > JMP                                                      ->63
   41    51    >   DECLARE_CLASS                                            'i2'
   45    52      > JMP                                                      ->63
   47    53    >   DECLARE_CLASS                                            'i3'
   48    54      > JMP                                                      ->63
   50    55    >   DECLARE_CLASS                                            't1'
   51    56      > JMP                                                      ->63
   53    57    >   DECLARE_CLASS                                            't2'
   54    58      > JMP                                                      ->63
   56    59    >   DECLARE_CLASS                                            'e1'
   60    60      > JMP                                                      ->63
   63    61    >   DECLARE_CLASS                                            'a1'
   64    62      > JMP                                                      ->63
   66    63    > > RETURN                                                   null

End of Dynamic Function 0

Class C1: [no user functions]
Class C2: [no user functions]
Class C3:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqWuo
function name:  method
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function method

End of class C3.

Class C4: [no user functions]
Class C5: [no user functions]
Class C6: [no user functions]
Class C7: [no user functions]
Class I1: [no user functions]
Class I2: [no user functions]
Class I3: [no user functions]
Class T1: [no user functions]
Class T2: [no user functions]
Class E1: [no user functions]
Class A1: [no user functions]
Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.91 ms | 968 KiB | 17 Q