3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Goo extends Foo {} interface Factory { static function create(Foo $foo); } class FooFactory implements Factory { static function create(Foo $foo) { return $foo; } } class GooFactory implements Factory { static function create(Goo $goo) { return $goo; } } var_dump(FooFactory::create(new Foo())); var_dump(GooFactory::create(new Goo()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F43Z4
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'foofactory'
   14     1        DECLARE_CLASS                                            'goofactory'
   18     2        INIT_FCALL                                               'var_dump'
          3        INIT_STATIC_METHOD_CALL                                  'FooFactory', 'create'
          4        NEW                                              $0      'Foo'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $0
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   19    10        INIT_FCALL                                               'var_dump'
         11        INIT_STATIC_METHOD_CALL                                  'GooFactory', 'create'
         12        NEW                                              $4      'Goo'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $4
         15        DO_FCALL                                      0  $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function create

End of class Factory.

Class FooFactory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F43Z4
function name:  create
number of ops:  3
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function create

End of class FooFactory.

Class GooFactory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F43Z4
function name:  create
number of ops:  3
compiled vars:  !0 = $goo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function create

End of class GooFactory.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.43 ms | 1396 KiB | 15 Q