3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum TestEnum: string { case One = 'one'; case Two = 'two'; case Three = 'three'; } var_dump(TestEnum::from('two')); var_dump(TestEnum::tryFrom('four'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vt9F5
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'testenum'
    9     1        INIT_FCALL                                               'var_dump'
          2        INIT_STATIC_METHOD_CALL                                  'TestEnum', 'from'
          3        SEND_VAL_EX                                              'two'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   10     7        INIT_FCALL                                               'var_dump'
          8        INIT_STATIC_METHOD_CALL                                  'TestEnum', 'tryFrom'
          9        SEND_VAL_EX                                              'four'
         10        DO_FCALL                                      0  $2      
         11        SEND_VAR                                                 $2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class TestEnum: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.62 ms | 996 KiB | 14 Q