3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ShipInterface {} abstract class AbstractShip implements ShipInterface {} class ShipOnlyAbstract extends AbstractShip {} class ShipWithInterface extends AbstractShip implements ShipInterface {} $shipOnlyAbstract = new ShipOnlyAbstract(); $shipWithInterface = new ShipWithInterface(); var_dump($shipOnlyAbstract instanceof AbstractShip); var_dump($shipWithInterface instanceof AbstractShip); var_dump($shipOnlyAbstract instanceof ShipInterface ); var_dump($shipWithInterface instanceof ShipInterface );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZsVM
function name:  (null)
number of ops:  26
compiled vars:  !0 = $shipOnlyAbstract, !1 = $shipWithInterface
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'abstractship'
    7     1        DECLARE_CLASS                                            'shiponlyabstract', 'abstractship'
    9     2        DECLARE_CLASS                                            'shipwithinterface', 'abstractship'
   12     3        NEW                                              $2      'ShipOnlyAbstract'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   13     6        NEW                                              $5      'ShipWithInterface'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $5
   15     9        INIT_FCALL                                               'var_dump'
         10        INSTANCEOF                                       ~8      !0, 'AbstractShip'
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
   16    13        INIT_FCALL                                               'var_dump'
         14        INSTANCEOF                                       ~10     !1, 'AbstractShip'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
   19    17        INIT_FCALL                                               'var_dump'
         18        INSTANCEOF                                       ~12     !0, 'ShipInterface'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
   20    21        INIT_FCALL                                               'var_dump'
         22        INSTANCEOF                                       ~14     !1, 'ShipInterface'
         23        SEND_VAL                                                 ~14
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class ShipInterface: [no user functions]
Class AbstractShip: [no user functions]
Class ShipOnlyAbstract: [no user functions]
Class ShipWithInterface: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.66 ms | 1395 KiB | 15 Q