3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Color { public function __construct(public string $name) {} } $white = new Color("white"); $blue = new Color("blue"); foreach([ 'white == blue' => $white == $blue, 'white === blue' => $white === $blue, 'white == white' => $white == new Color("white"), 'white === white' => $white === new Color("white"), ] as $m => $v) { $v = $v ? "true" : "false"; echo "$m: $v\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 36
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 36
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/uZTsN
function name:  (null)
number of ops:  38
compiled vars:  !0 = $white, !1 = $blue, !2 = $v, !3 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $4      'Color'
          1        SEND_VAL_EX                                                  'white'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $4
    8     4        NEW                                                  $7      'Color'
          5        SEND_VAL_EX                                                  'blue'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $7
   11     8        IS_EQUAL                                             ~10     !0, !1
          9        INIT_ARRAY                                           ~11     ~10, 'white+%3D%3D+blue'
   12    10        IS_IDENTICAL                                         ~12     !0, !1
         11        ADD_ARRAY_ELEMENT                                    ~11     ~12, 'white+%3D%3D%3D+blue'
   13    12        NEW                                                  $13     'Color'
         13        SEND_VAL_EX                                                  'white'
         14        DO_FCALL                                          0          
         15        IS_EQUAL                                             ~15     !0, $13
         16        ADD_ARRAY_ELEMENT                                    ~11     ~15, 'white+%3D%3D+white'
   14    17        NEW                                                  $16     'Color'
         18        SEND_VAL_EX                                                  'white'
         19        DO_FCALL                                          0          
         20        IS_IDENTICAL                                         ~18     !0, $16
         21        ADD_ARRAY_ELEMENT                                    ~11     ~18, 'white+%3D%3D%3D+white'
         22      > FE_RESET_R                                           $19     ~11, ->36
         23    > > FE_FETCH_R                                           ~20     $19, !2, ->36
   15    24    >   ASSIGN                                                       !3, ~20
   16    25      > JMPZ                                                         !2, ->28
         26    >   QM_ASSIGN                                            ~22     'true'
         27      > JMP                                                          ->29
         28    >   QM_ASSIGN                                            ~22     'false'
         29    >   ASSIGN                                                       !2, ~22
   17    30        ROPE_INIT                                         4  ~25     !3
         31        ROPE_ADD                                          1  ~25     ~25, '%3A+'
         32        ROPE_ADD                                          2  ~25     ~25, !2
         33        ROPE_END                                          3  ~24     ~25, '%0A'
         34        ECHO                                                         ~24
   11    35      > JMP                                                          ->23
         36    >   FE_FREE                                                      $19
   18    37      > RETURN                                                       1

Class Color:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uZTsN
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'name'
          2        OP_DATA                                                      !0
          3      > RETURN                                                       null

End of function __construct

End of class Color.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.3 ms | 1453 KiB | 13 Q