3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function f ( $foo ) { var_dump($foo instanceof static); } } class D extends C { } $c = new C(); $c->f(new D()); $d = new D(); $d->f($d); $d->f($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TrcZg
function name:  (null)
number of ops:  18
compiled vars:  !0 = $c, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'f'
          4        NEW                                              $5      'D'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $5
          7        DO_FCALL                                      0          
   16     8        NEW                                              $8      'D'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
   17    11        INIT_METHOD_CALL                                         !1, 'f'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
   18    14        INIT_METHOD_CALL                                         !1, 'f'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TrcZg
function name:  f
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        INSTANCEOF                                       ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
    8     5      > RETURN                                                   null

End of function f

End of class C.

Class D:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TrcZg
function name:  f
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        INSTANCEOF                                       ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
    8     5      > RETURN                                                   null

End of function f

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.31 ms | 1396 KiB | 15 Q