3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BaseThing { } final class AThing extends BaseThing { } final class BThing extends BaseThing { } function foo(BaseThing $t) { if (! ($t instanceof AThing || $t instanceof BThing)) { throw new \InvalidArgumentException('nope'); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YhbWL
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/YhbWL
function name:  foo
number of ops:  12
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INSTANCEOF                                       ~1      !0, 'AThing'
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   INSTANCEOF                                       ~2      !0, 'BThing'
          4        BOOL                                             ~1      ~2
          5    >   BOOL_NOT                                         ~3      ~1
          6      > JMPZ                                                     ~3, ->11
          7    >   NEW                                              $4      'InvalidArgumentException'
          8        SEND_VAL_EX                                              'nope'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $4
   18    11    > > RETURN                                                   null

End of function foo

Class BaseThing: [no user functions]
Class AThing: [no user functions]
Class BThing: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.21 ms | 1394 KiB | 13 Q