3v4l.org

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

Class TestEnum: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
179.85 ms | 1523 KiB | 14 Q