3v4l.org

run code in 500+ PHP versions simultaneously
<?php $indexValues = array( null, '0000000000000000000000000000000000000000', '', ); $results = array(); $expected = array(); foreach($indexValues as $indexValue) { $expected[] = $indexValue === null ? '' : $indexValue; $indexValue = $indexValue !== null ?: ''; $results[] = $indexValue; } var_dump($results); var_dump($expected);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/tiJvR
function name:  (null)
number of ops:  27
compiled vars:  !0 = $indexValues, !1 = $results, !2 = $expected, !3 = $indexValue
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   10     2        ASSIGN                                                       !2, <array>
   11     3      > FE_RESET_R                                           $7      !0, ->19
          4    > > FE_FETCH_R                                                   $7, !3, ->19
   12     5    >   TYPE_CHECK                                        2          !3
          6      > JMPZ                                                         ~9, ->9
          7    >   QM_ASSIGN                                            ~10     ''
          8      > JMP                                                          ->10
          9    >   QM_ASSIGN                                            ~10     !3
         10    >   ASSIGN_DIM                                                   !2
         11        OP_DATA                                                      ~10
   13    12        TYPE_CHECK                                      1020  ~11     !3
         13        JMP_SET                                              ~12     ~11, ->15
         14        QM_ASSIGN                                            ~12     ''
         15        ASSIGN                                                       !3, ~12
   14    16        ASSIGN_DIM                                                   !1
         17        OP_DATA                                                      !3
   11    18      > JMP                                                          ->4
         19    >   FE_FREE                                                      $7
   16    20        INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
   17    23        INIT_FCALL                                                   'var_dump'
         24        SEND_VAR                                                     !2
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.93 ms | 3408 KiB | 14 Q