3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { var $j; } class Y { var $j; } $x = new X(); switch ($x) { case new Y(): return "Matched a Y"; break; case new X(): echo "Matched an X"; break; default: echo "No match"; break; //outputs "Matched an X" }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ZFjk
function name:  (null)
number of ops:  19
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   NEW                                                  $1      'X'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
    9     3        NEW                                                  $5      'Y'
          4        DO_FCALL                                          0          
          5        IS_EQUAL                                                     !0, $5
          6      > JMPNZ                                                        ~4, ->12
   12     7    >   NEW                                                  $7      'X'
          8        DO_FCALL                                          0          
          9        IS_EQUAL                                                     !0, $7
         10      > JMPNZ                                                        ~4, ->14
         11    > > JMP                                                          ->16
   10    12    > > RETURN                                                       'Matched+a+Y'
   11    13*       JMP                                                          ->18
   13    14    >   ECHO                                                         'Matched+an+X'
   14    15      > JMP                                                          ->18
   16    16    >   ECHO                                                         'No+match'
   17    17      > JMP                                                          ->18
   19    18    > > RETURN                                                       1

Class X: [no user functions]
Class Y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
123.93 ms | 475 KiB | 7 Q