3v4l.org

run code in 500+ PHP versions simultaneously
<?php enum MyEnum : int { case MyEnumCase1 = 1; } $value = null; // NULL is a deprecated value. try { MyEnum::tryFrom($value); echo 'tryFrom() succeeded'."\n"; } catch (Throwable $exception) { echo 'tryFrom() failed'."\n"; echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* Deprecated: MyEnum::tryFrom(): Passing null to parameter #1 ($value) of type string|int is deprecated in /in/oEp7N on line 9 tryFrom() succeeded */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Wu1R
function name:  (null)
number of ops:  17
compiled vars:  !0 = $value, !1 = $exception
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'myenum'
    7     1        ASSIGN                                                       !0, null
    9     2        INIT_STATIC_METHOD_CALL                                      'MyEnum', 'tryFrom'
          3        SEND_VAR_EX                                                  !0
          4        DO_FCALL                                          0          
   10     5        ECHO                                                         'tryFrom%28%29+succeeded%0A'
          6      > JMP                                                          ->16
   11     7  E > > CATCH                                           last         'Throwable'
   12     8    >   ECHO                                                         'tryFrom%28%29+failed%0A'
   13     9        FETCH_CLASS_NAME                                     ~4      !1
         10        ECHO                                                         ~4
         11        ECHO                                                         '%3A+'
         12        INIT_METHOD_CALL                                             !1, 'getMessage'
         13        DO_FCALL                                          0  $5      
         14        ECHO                                                         $5
         15        ECHO                                                         '%0A'
   19    16    > > RETURN                                                       1

Class MyEnum: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.12 ms | 474 KiB | 7 Q