3v4l.org

run code in 300+ PHP versions simultaneously
<?php $empty_values = [ "empty-string" => "", "0 (int)" => 0, "0 (float)" => 0.0, "0 (string)" => "0", "null" => null, "boolean false" => false, "empty array" => [] ]; foreach ($empty_values as $explanation=>$value) { $test = empty($value) ? 'foo' : 'bar'; if ($test !== ($value ?: 'foo')) { echo "discrepency on " . $explanation . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/tPdU4
function name:  (null)
number of ops:  20
compiled vars:  !0 = $empty_values, !1 = $value, !2 = $explanation, !3 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $5      !0, ->18
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->18
          3    >   ASSIGN                                                   !2, ~6
   13     4        ISSET_ISEMPTY_CV                                         !1
          5      > JMPZ                                                     ~8, ->8
          6    >   QM_ASSIGN                                        ~9      'foo'
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~9      'bar'
          9    >   ASSIGN                                                   !3, ~9
   14    10        JMP_SET                                          ~11     !1, ->12
         11        QM_ASSIGN                                        ~11     'foo'
         12        IS_NOT_IDENTICAL                                         !3, ~11
         13      > JMPZ                                                     ~12, ->17
   15    14    >   CONCAT                                           ~13     'discrepency+on+', !2
         15        CONCAT                                           ~14     ~13, '%0A'
         16        ECHO                                                     ~14
   12    17    > > JMP                                                      ->2
         18    >   FE_FREE                                                  $5
   17    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.52 ms | 1394 KiB | 13 Q