3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{} class AnotherTest{} $instance1 = new Test(); $instance2 = $instance1; $instance3 = & $instance1; var_dump($instance1 instanceof Test); // True var_dump($instance2 instanceof Test); // True var_dump($instance3 instanceof Test); // True $instance3 = new AnotherTest(); var_dump($instance1 instanceof AnotherTest); // True var_dump($instance2 instanceof AnotherTest); // False var_dump($instance3 instanceof AnotherTest); // True
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqLsH
function name:  (null)
number of ops:  33
compiled vars:  !0 = $instance1, !1 = $instance2, !2 = $instance3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    5     3        ASSIGN                                                   !1, !0
    6     4        ASSIGN_REF                                               !2, !0
    8     5        INIT_FCALL                                               'var_dump'
          6        INSTANCEOF                                       ~8      !0, 'Test'
          7        SEND_VAL                                                 ~8
          8        DO_ICALL                                                 
    9     9        INIT_FCALL                                               'var_dump'
         10        INSTANCEOF                                       ~10     !1, 'Test'
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
   10    13        INIT_FCALL                                               'var_dump'
         14        INSTANCEOF                                       ~12     !2, 'Test'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
   12    17        NEW                                              $14     'AnotherTest'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !2, $14
   14    20        INIT_FCALL                                               'var_dump'
         21        INSTANCEOF                                       ~17     !0, 'AnotherTest'
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                                 
   15    24        INIT_FCALL                                               'var_dump'
         25        INSTANCEOF                                       ~19     !1, 'AnotherTest'
         26        SEND_VAL                                                 ~19
         27        DO_ICALL                                                 
   16    28        INIT_FCALL                                               'var_dump'
         29        INSTANCEOF                                       ~21     !2, 'AnotherTest'
         30        SEND_VAL                                                 ~21
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Class Test: [no user functions]
Class AnotherTest: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.98 ms | 941 KiB | 16 Q