3v4l.org

run code in 300+ PHP versions simultaneously
<?php declar('types=strict'); $class_aliases = [ 'FooAlias' => 'Foo' ]; spl_autoload_register(function($class) use ($class_aliases) { if (isset($class_aliases[$class])) { class_alias($class_aliases[$class], $class); return true; } }); class Foo {} class Bar extends Foo {} class FooCreator { public function create(FooAlias $foo) { } } $foo = new Bar; $creator = new FooCreator(); $creator->create($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p33fg
function name:  (null)
number of ops:  19
compiled vars:  !0 = $class_aliases, !1 = $foo, !2 = $creator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'declar'
          1        SEND_VAL_EX                                              'types%3Dstrict'
          2        DO_FCALL                                      0          
    4     3        ASSIGN                                                   !0, <array>
    8     4        INIT_FCALL                                               'spl_autoload_register'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fp33fg%3A8%240'
          6        BIND_LEXICAL                                             ~5, !0
   13     7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   27     9        NEW                                              $7      'Bar'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   28    12        NEW                                              $10     'FooCreator'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $10
   31    15        INIT_METHOD_CALL                                         !2, 'create'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fp33fg%3A8%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p33fg
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $class, !1 = $class_aliases
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    9     2        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !0
          3      > JMPZ                                                     ~2, ->10
   10     4    >   INIT_FCALL                                               'class_alias'
          5        FETCH_DIM_R                                      ~3      !1, !0
          6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   11     9      > RETURN                                                   <true>
   13    10    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fp33fg%3A8%240

Class Foo: [no user functions]
Class Bar: [no user functions]
Class FooCreator:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p33fg
function name:  create
number of ops:  2
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1      > RETURN                                                   null

End of function create

End of class FooCreator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.28 ms | 1400 KiB | 17 Q