3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0jhLN
function name:  foo
number of ops:  16
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, ->7
          3    >   FETCH_CONSTANT                                   ~3      'a'
          4        FETCH_DIM_R                                      ~4      ~3, 'page'
          5        QM_ASSIGN                                        ~5      ~4
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~5      1
          8    >   ASSIGN                                                   !1, ~5
    6     9        ECHO                                                     !1
         10        ECHO                                                     '%0A'
    8    11        FETCH_DIM_IS                                     ~7      !0, 'page'
         12        COALESCE                                         ~8      ~7
         13        QM_ASSIGN                                        ~8      1
         14        ECHO                                                     ~8
    9    15      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.03 ms | 1399 KiB | 16 Q