3v4l.org

run code in 300+ PHP versions simultaneously
<?php function incre() { return [ 1 => null, 2 => null, 3 => 1, ]; } $a = incre()[0] ?? 0; var_dump($a); $b = incre()[1] ?? 0; var_dump($b); $c = incre()[3] ?? 0; var_dump($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cFjLf
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'incre'
          1        DO_FCALL                                      0  $3      
          2        FETCH_DIM_IS                                     ~4      $3, 0
          3        COALESCE                                         ~5      ~4
          4        QM_ASSIGN                                        ~5      0
          5        ASSIGN                                                   !0, ~5
   12     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'incre'
         10        DO_FCALL                                      0  $8      
         11        FETCH_DIM_IS                                     ~9      $8, 1
         12        COALESCE                                         ~10     ~9
         13        QM_ASSIGN                                        ~10     0
         14        ASSIGN                                                   !1, ~10
   15    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   17    18        INIT_FCALL                                               'incre'
         19        DO_FCALL                                      0  $13     
         20        FETCH_DIM_IS                                     ~14     $13, 3
         21        COALESCE                                         ~15     ~14
         22        QM_ASSIGN                                        ~15     0
         23        ASSIGN                                                   !2, ~15
   18    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function incre:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cFjLf
function name:  incre
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   <array>
    8     1*     > RETURN                                                   null

End of function incre

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.94 ms | 1399 KiB | 18 Q