3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($a) { $page = isset($a['page']) ? $a['page'] : 1; echo $page, "\n"; $page = $a['page'] ?? 1; echo $page, "\n"; } $a = array(); foo($a); $a = array('page' => Null); foo($a); $a = array('page' => 0); foo($a); $a = array('page' => 3); foo($a); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kL1KS
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'foo'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   16     4        ASSIGN                                                   !0, <array>
   17     5        INIT_FCALL                                               'foo'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   19     8        ASSIGN                                                   !0, <array>
   20     9        INIT_FCALL                                               'foo'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
   22    12        ASSIGN                                                   !0, <array>
   23    13        INIT_FCALL                                               'foo'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0          
   24    16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kL1KS
function name:  foo
number of ops:  17
compiled vars:  !0 = $a, !1 = $page
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'page'
          2      > JMPZ                                                     ~2, ->6
          3    >   FETCH_DIM_R                                      ~3      !0, 'page'
          4        QM_ASSIGN                                        ~4      ~3
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      1
          7    >   ASSIGN                                                   !1, ~4
    6     8        ECHO                                                     !1
          9        ECHO                                                     '%0A'
    8    10        FETCH_DIM_IS                                     ~6      !0, 'page'
         11        COALESCE                                         ~7      ~6
         12        QM_ASSIGN                                        ~7      1
         13        ASSIGN                                                   !1, ~7
   10    14        ECHO                                                     !1
         15        ECHO                                                     '%0A'
   11    16      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.26 ms | 1399 KiB | 17 Q