3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } $test = array(); echo $test ? 'truthy' : 'empty', "\r\n"; echo isset_or($test[0][0], '$test[0][0] is not set'), "\r\n"; echo $test ? 'truthy' : 'empty', "\r\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
filename:       /in/sMsKD
function name:  (null)
number of ops:  22
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   10     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~2      'truthy'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~2      'empty'
          5    >   ECHO                                                     ~2
          6        ECHO                                                     '%0D%0A'
   11     7        INIT_FCALL                                               'isset_or'
          8        FETCH_DIM_W                                      $3      !0, 0
          9        FETCH_DIM_W                                      $4      $3, 0
         10        SEND_REF                                                 $4
         11        SEND_VAL                                                 '%24test%5B0%5D%5B0%5D+is+not+set'
         12        DO_FCALL                                      0  $5      
         13        ECHO                                                     $5
         14        ECHO                                                     '%0D%0A'
   12    15      > JMPZ                                                     !0, ->18
         16    >   QM_ASSIGN                                        ~6      'truthy'
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~6      'empty'
         19    >   ECHO                                                     ~6
         20        ECHO                                                     '%0D%0A'
         21      > RETURN                                                   1

Function isset_or:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
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/sMsKD
function name:  isset_or
number of ops:  9
compiled vars:  !0 = $check, !1 = $alternate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    5     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      !0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      !1
          7    > > RETURN                                                   ~3
    6     8*     > RETURN                                                   null

End of function isset_or

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.19 ms | 1403 KiB | 14 Q