3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { (function () { return "string" + throw null ?? throw new Exception('return throw null ?? throw new Exception();'); })(); } catch (Exception $e) { var_dump($e->getMessage()); } try { (function () { return "string1" . 5 . "ok" / throw throw throw throw new Exception("cool"); })(); } catch (Exception $e) { var_dump($e->getMessage()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WkOUr
function name:  (null)
number of ops:  21
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    6     1        INIT_DYNAMIC_CALL                                        ~1
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->10
    7     4  E > > CATCH                                       last         'Exception'
    8     5    >   INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getMessage'
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   12    10    >   DECLARE_LAMBDA_FUNCTION                          ~5      [1]
   14    11        INIT_DYNAMIC_CALL                                        ~5
         12        DO_FCALL                                      0          
         13      > JMP                                                      ->20
   15    14  E > > CATCH                                       last         'Exception'
   16    15    >   INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'getMessage'
         17        DO_FCALL                                      0  $7      
         18        SEND_VAR                                                 $7
         19        DO_ICALL                                                 
   17    20    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/WkOUr
function name:  {closure}
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   COALESCE                                         ~0      null
          1        NEW                                              $1      'Exception'
          2        SEND_VAL_EX                                              'return+throw+null+%3F%3F+throw+new+Exception%28%29%3B'
          3        DO_FCALL                                      0          
          4      > THROW                                         1          $1
          5*       QM_ASSIGN                                        ~0      <true>
          6*       THROW                                         1          ~0
          7*       ADD                                              ~3      'string', <true>
          8*       RETURN                                                   ~3
    6     9*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/WkOUr
function name:  {closure}
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'cool'
          2        DO_FCALL                                      0          
          3      > THROW                                         1          $0
          4*       THROW                                         1          <true>
          5*       THROW                                         1          <true>
          6*       THROW                                         1          <true>
          7*       DIV                                              ~2      'ok', <true>
          8*       CONCAT                                           ~3      'string15', ~2
          9*       RETURN                                                   ~3
   14    10*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.13 ms | 1007 KiB | 14 Q