3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($a) { $page1 = isset($a['page']) ? $a['page'] : 1; echo 'P: ', $page1, "\n"; $page2 = $a['page'] ?? 1; echo 'P: ', $page2, "\n"; echo $page1 == $page2 ? 't' : 'n', "\n"; } $a = array('page' => 3); foo($a); $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/WuXZ3
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'foo'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   17     4        ASSIGN                                                   !0, <array>
   18     5        INIT_FCALL                                               'foo'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   20     8        ASSIGN                                                   !0, <array>
   21     9        INIT_FCALL                                               'foo'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
   23    12        ASSIGN                                                   !0, <array>
   24    13        INIT_FCALL                                               'foo'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0          
   26    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
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
Branch analysis from position: 22
filename:       /in/WuXZ3
function name:  foo
number of ops:  26
compiled vars:  !0 = $a, !1 = $page1, !2 = $page2
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                                                     ~3, ->6
          3    >   FETCH_DIM_R                                      ~4      !0, 'page'
          4        QM_ASSIGN                                        ~5      ~4
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~5      1
          7    >   ASSIGN                                                   !1, ~5
    6     8        ECHO                                                     'P%3A+'
          9        ECHO                                                     !1
         10        ECHO                                                     '%0A'
    8    11        FETCH_DIM_IS                                     ~7      !0, 'page'
         12        COALESCE                                         ~8      ~7
         13        QM_ASSIGN                                        ~8      1
         14        ASSIGN                                                   !2, ~8
   10    15        ECHO                                                     'P%3A+'
         16        ECHO                                                     !2
         17        ECHO                                                     '%0A'
   12    18        IS_EQUAL                                                 !1, !2
         19      > JMPZ                                                     ~10, ->22
         20    >   QM_ASSIGN                                        ~11     't'
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~11     'n'
         23    >   ECHO                                                     ~11
         24        ECHO                                                     '%0A'
   13    25      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.33 ms | 1402 KiB | 17 Q