3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); namespace App; spl_autoload_register(function (string $name): void { printf("autoload: %s\n", $name); }); use stdClass; use Lib\Bar; final class Foo { public C1 $c1; public function method(C2 $c2) {} } $foo = new Foo(); try { $foo->c1 = new stdClass(); } catch (\Throwable $e) { // TypeError にはなるがオートローダは実行されない var_dump($e->getMessage()); } try { $foo->method(new stdClass()); } catch (\Throwable $e) { // TypeError にはなるがオートローダは実行されない var_dump($e->getMessage()); } var_dump(C3::class); var_dump($foo instanceOf C4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Found catch point at position: 24
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MtoWM
function name:  (null)
number of ops:  38
compiled vars:  !0 = $foo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_NS_FCALL_BY_NAME                                    'App%5Cspl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00app%5C%7Bclosure%7D%2Fin%2FMtoWM%3A6%240'
    8     2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
   20     4        NEW                                              $4      'App%5CFoo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   22     7        NEW                                              $8      'stdClass'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               !0, 'c1'
         10        OP_DATA                                                  $8
         11      > JMP                                                      ->18
   23    12  E > > CATCH                                       last         'Throwable'
   25    13    >   INIT_NS_FCALL_BY_NAME                                    'App%5Cvar_dump'
         14        INIT_METHOD_CALL                                         !1, 'getMessage'
         15        DO_FCALL                                      0  $10     
         16        SEND_VAR_NO_REF_EX                                       $10
         17        DO_FCALL                                      0          
   28    18    >   INIT_METHOD_CALL                                         !0, 'method'
         19        NEW                                              $12     'stdClass'
         20        DO_FCALL                                      0          
         21        SEND_VAR_NO_REF_EX                                       $12
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->30
   29    24  E > > CATCH                                       last         'Throwable'
   31    25    >   INIT_NS_FCALL_BY_NAME                                    'App%5Cvar_dump'
         26        INIT_METHOD_CALL                                         !1, 'getMessage'
         27        DO_FCALL                                      0  $15     
         28        SEND_VAR_NO_REF_EX                                       $15
         29        DO_FCALL                                      0          
   34    30    >   INIT_NS_FCALL_BY_NAME                                    'App%5Cvar_dump'
         31        SEND_VAL_EX                                              'App%5CC3'
         32        DO_FCALL                                      0          
   35    33        INIT_NS_FCALL_BY_NAME                                    'App%5Cvar_dump'
         34        INSTANCEOF                                       ~18     !0, 'App%5CC4'
         35        SEND_VAL_EX                                              ~18
         36        DO_FCALL                                      0          
         37      > RETURN                                                   1

Function %00app%5C%7Bclosure%7D%2Fin%2FMtoWM%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MtoWM
function name:  App\{closure}
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_NS_FCALL_BY_NAME                                    'App%5Cprintf'
          2        SEND_VAL_EX                                              'autoload%3A+%25s%0A'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
    8     5      > RETURN                                                   null

End of function %00app%5C%7Bclosure%7D%2Fin%2FMtoWM%3A6%240

Class App\Foo:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MtoWM
function name:  method
number of ops:  2
compiled vars:  !0 = $c2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function method

End of class App\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.57 ms | 1411 KiB | 19 Q