3v4l.org

run code in 500+ PHP versions simultaneously
<?php try { $name ?? throw new Exception("variable is null or not defined"); } catch (Exception $e) { echo $e->getMessage() . "\n"; } try { $name = ''; $name ?: throw new Exception("variable is falsy"); } catch (Exception $e) { echo $e->getMessage() . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/14aPa
function name:  (null)
number of ops:  28
compiled vars:  !0 = $name, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   COALESCE                                             ~2      !0
          1        NEW                                                  $3      'Exception'
          2        SEND_VAL_EX                                                  'variable+is+null+or+not+defined'
          3        DO_FCALL                                          0          
          4      > THROW                                             1          $3
          5*       QM_ASSIGN                                            ~2      <true>
          6*       FREE                                                         ~2
          7*       JMP                                                          ->13
    5     8  E > > CATCH                                           last         'Exception'
    6     9    >   INIT_METHOD_CALL                                             !1, 'getMessage'
         10        DO_FCALL                                          0  $5      
         11        CONCAT                                               ~6      $5, '%0A'
         12        ECHO                                                         ~6
   10    13        ASSIGN                                                       !0, ''
   11    14        JMP_SET                                              ~8      !0, ->20
         15        NEW                                                  $9      'Exception'
         16        SEND_VAL_EX                                                  'variable+is+falsy'
         17        DO_FCALL                                          0          
         18      > THROW                                             1          $9
         19*       QM_ASSIGN                                            ~8      <true>
         20*       FREE                                                         ~8
         21*       JMP                                                          ->27
   12    22  E > > CATCH                                           last         'Exception'
   13    23    >   INIT_METHOD_CALL                                             !1, 'getMessage'
         24        DO_FCALL                                          0  $11     
         25        CONCAT                                               ~12     $11, '%0A'
         26        ECHO                                                         ~12
   14    27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.76 ms | 1447 KiB | 13 Q