3v4l.org

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

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/DYQhe
function name:  x
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $0      'Exception'
          1        DO_FCALL                                      0          
          2      > THROW                                         0          $0
          3*     > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.11 ms | 1003 KiB | 16 Q