3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum TestEnum { case A; } $enum = TestEnum::A; $truthy = true; var_dump($enum == true); var_dump(TestEnum::A == true); var_dump($enum == $truthy); var_dump(TestEnum::A == $truthy);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OOTcA
function name:  (null)
number of ops:  23
compiled vars:  !0 = $enum, !1 = $truthy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'testenum'
    8     1        FETCH_CLASS_CONSTANT                             ~2      'TestEnum', 'A'
          2        ASSIGN                                                   !0, ~2
    9     3        ASSIGN                                                   !1, <true>
   11     4        INIT_FCALL                                               'var_dump'
          5        BOOL                                             ~5      !0
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   12     8        INIT_FCALL                                               'var_dump'
          9        FETCH_CLASS_CONSTANT                             ~7      'TestEnum', 'A'
         10        BOOL                                             ~8      ~7
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
   13    13        INIT_FCALL                                               'var_dump'
         14        IS_EQUAL                                         ~10     !0, !1
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
   14    17        INIT_FCALL                                               'var_dump'
         18        FETCH_CLASS_CONSTANT                             ~12     'TestEnum', 'A'
         19        IS_EQUAL                                         ~13     !1, ~12
         20        SEND_VAL                                                 ~13
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class TestEnum: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.69 ms | 1444 KiB | 14 Q