3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B extends A {} class Foo { public function test(B $a) { var_dump(get_class($a)); } } class Bar extends Foo { public function test(A $a) { parent::test($a); } } (new Foo)->test(new A); (new Foo)->test(new B); (new Bar)->test(new A); (new Bar)->test(new B);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dHDQt
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'test'
          3        NEW                                              $2      'A'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
   17     7        NEW                                              $5      'Foo'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $5, 'test'
         10        NEW                                              $7      'B'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $7
         13        DO_FCALL                                      0          
   18    14        NEW                                              $10     'Bar'
         15        DO_FCALL                                      0          
         16        INIT_METHOD_CALL                                         $10, 'test'
         17        NEW                                              $12     'A'
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $12
         20        DO_FCALL                                      0          
   19    21        NEW                                              $15     'Bar'
         22        DO_FCALL                                      0          
         23        INIT_METHOD_CALL                                         $15, 'test'
         24        NEW                                              $17     'B'
         25        DO_FCALL                                      0          
         26        SEND_VAR_NO_REF_EX                                       $17
         27        DO_FCALL                                      0          
         28      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dHDQt
function name:  test
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        GET_CLASS                                        ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
    8     5      > RETURN                                                   null

End of function test

End of class Foo.

Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dHDQt
function name:  test
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_STATIC_METHOD_CALL                                  'test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function test

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1405 KiB | 15 Q