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 is ', $test ? 'truthy' : 'empty', ', with ' . count($test) . ' item(s)', "\r\n"; echo '$test[0][0] is ', isset_or($test[0][0], 'not set'), "\r\n"; echo '$test is ', $test ? 'truthy' : 'empty', ', with ' . count($test) . ' item(s)', "\r\n"; echo "\r\n"; var_export($test);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
Branch analysis from position: 25
filename:       /in/csruJ
function name:  (null)
number of ops:  37
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   10     1        ECHO                                                     '%24test+is+'
          2      > JMPZ                                                     !0, ->5
          3    >   QM_ASSIGN                                        ~2      'truthy'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      'empty'
          6    >   ECHO                                                     ~2
          7        COUNT                                            ~3      !0
          8        CONCAT                                           ~4      '%2C+with+', ~3
          9        CONCAT                                           ~5      ~4, '+item%28s%29'
         10        ECHO                                                     ~5
         11        ECHO                                                     '%0D%0A'
   11    12        ECHO                                                     '%24test%5B0%5D%5B0%5D+is+'
         13        INIT_FCALL                                               'isset_or'
         14        FETCH_DIM_W                                      $6      !0, 0
         15        FETCH_DIM_W                                      $7      $6, 0
         16        SEND_REF                                                 $7
         17        SEND_VAL                                                 'not+set'
         18        DO_FCALL                                      0  $8      
         19        ECHO                                                     $8
         20        ECHO                                                     '%0D%0A'
   12    21        ECHO                                                     '%24test+is+'
         22      > JMPZ                                                     !0, ->25
         23    >   QM_ASSIGN                                        ~9      'truthy'
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~9      'empty'
         26    >   ECHO                                                     ~9
         27        COUNT                                            ~10     !0
         28        CONCAT                                           ~11     '%2C+with+', ~10
         29        CONCAT                                           ~12     ~11, '+item%28s%29'
         30        ECHO                                                     ~12
         31        ECHO                                                     '%0D%0A'
   13    32        ECHO                                                     '%0D%0A'
   14    33        INIT_FCALL                                               'var_export'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
         36      > 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/csruJ
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:
194.09 ms | 1458 KiB | 15 Q