3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); enum Foo: int { case A = 1; case B = 2; } var_dump(Foo::A > Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false) var_dump(Foo::A < Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false) var_dump(Foo::A === Foo::B); // OK var_dump(Foo::A == Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false) var_dump(Foo::A === Foo::A); // I expect an error here as it is always true var_dump(Foo::A->value > Foo::B->value); // OK var_dump(Foo::A->value < Foo::B->value); // OK var_dump(Foo::A->value === Foo::B->value); // OK var_dump(Foo::A->value == Foo::B->value); // I'd probably expect an error here as well as always false var_dump(Foo::A->value === Foo::A->value); // I'd probably expect an error here as well as this is always true
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I2MUn
function name:  (null)
number of ops:  72
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
    9     1        INIT_FCALL                                               'var_dump'
          2        FETCH_CLASS_CONSTANT                             ~0      'Foo', 'A'
          3        FETCH_CLASS_CONSTANT                             ~1      'Foo', 'B'
          4        IS_SMALLER                                       ~2      ~1, ~0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
   10     7        INIT_FCALL                                               'var_dump'
          8        FETCH_CLASS_CONSTANT                             ~4      'Foo', 'A'
          9        FETCH_CLASS_CONSTANT                             ~5      'Foo', 'B'
         10        IS_SMALLER                                       ~6      ~4, ~5
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
   11    13        INIT_FCALL                                               'var_dump'
         14        FETCH_CLASS_CONSTANT                             ~8      'Foo', 'A'
         15        FETCH_CLASS_CONSTANT                             ~9      'Foo', 'B'
         16        IS_IDENTICAL                                     ~10     ~8, ~9
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'var_dump'
         20        FETCH_CLASS_CONSTANT                             ~12     'Foo', 'A'
         21        FETCH_CLASS_CONSTANT                             ~13     'Foo', 'B'
         22        IS_EQUAL                                         ~14     ~12, ~13
         23        SEND_VAL                                                 ~14
         24        DO_ICALL                                                 
   13    25        INIT_FCALL                                               'var_dump'
         26        FETCH_CLASS_CONSTANT                             ~16     'Foo', 'A'
         27        FETCH_CLASS_CONSTANT                             ~17     'Foo', 'A'
         28        IS_IDENTICAL                                     ~18     ~16, ~17
         29        SEND_VAL                                                 ~18
         30        DO_ICALL                                                 
   15    31        INIT_FCALL                                               'var_dump'
         32        FETCH_CLASS_CONSTANT                             ~20     'Foo', 'A'
         33        FETCH_OBJ_R                                      ~21     ~20, 'value'
         34        FETCH_CLASS_CONSTANT                             ~22     'Foo', 'B'
         35        FETCH_OBJ_R                                      ~23     ~22, 'value'
         36        IS_SMALLER                                       ~24     ~23, ~21
         37        SEND_VAL                                                 ~24
         38        DO_ICALL                                                 
   16    39        INIT_FCALL                                               'var_dump'
         40        FETCH_CLASS_CONSTANT                             ~26     'Foo', 'A'
         41        FETCH_OBJ_R                                      ~27     ~26, 'value'
         42        FETCH_CLASS_CONSTANT                             ~28     'Foo', 'B'
         43        FETCH_OBJ_R                                      ~29     ~28, 'value'
         44        IS_SMALLER                                       ~30     ~27, ~29
         45        SEND_VAL                                                 ~30
         46        DO_ICALL                                                 
   17    47        INIT_FCALL                                               'var_dump'
         48        FETCH_CLASS_CONSTANT                             ~32     'Foo', 'A'
         49        FETCH_OBJ_R                                      ~33     ~32, 'value'
         50        FETCH_CLASS_CONSTANT                             ~34     'Foo', 'B'
         51        FETCH_OBJ_R                                      ~35     ~34, 'value'
         52        IS_IDENTICAL                                     ~36     ~33, ~35
         53        SEND_VAL                                                 ~36
         54        DO_ICALL                                                 
   18    55        INIT_FCALL                                               'var_dump'
         56        FETCH_CLASS_CONSTANT                             ~38     'Foo', 'A'
         57        FETCH_OBJ_R                                      ~39     ~38, 'value'
         58        FETCH_CLASS_CONSTANT                             ~40     'Foo', 'B'
         59        FETCH_OBJ_R                                      ~41     ~40, 'value'
         60        IS_EQUAL                                         ~42     ~39, ~41
         61        SEND_VAL                                                 ~42
         62        DO_ICALL                                                 
   19    63        INIT_FCALL                                               'var_dump'
         64        FETCH_CLASS_CONSTANT                             ~44     'Foo', 'A'
         65        FETCH_OBJ_R                                      ~45     ~44, 'value'
         66        FETCH_CLASS_CONSTANT                             ~46     'Foo', 'A'
         67        FETCH_OBJ_R                                      ~47     ~46, 'value'
         68        IS_IDENTICAL                                     ~48     ~45, ~47
         69        SEND_VAL                                                 ~48
         70        DO_ICALL                                                 
         71      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.57 ms | 1093 KiB | 14 Q