3v4l.org

run code in 500+ PHP versions simultaneously
<?php $falses = [ 'aFalseBool' => false, 'aFalseString' => 'false', 'aNull' => null, 'zero' => 0, 'emptyString' => '', ]; $truths = [ 'aTrueBool' => true, 'aTrueString' => 'true', 'non-zero' => 42, 'anyString' => 'anystring', ]; echo "These should be false:" . PHP_EOL; foreach($falses as $key => $item) { if ((bool) $item === false) { printf("%s is false\n", $key); } else { printf("%s is not false\n", $key); } } echo "These should be true:" . PHP_EOL; foreach($truths as $key => $item) { if ((bool) $item === true) { printf("%s is true\n", $key); } else { printf("%s is not true\n", $key); } }
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 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 37
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 19
filename:       /in/t1LlD
function name:  (null)
number of ops:  39
compiled vars:  !0 = $falses, !1 = $truths, !2 = $item, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   18     2        ECHO                                                         'These+should+be+false%3A%0A'
   19     3      > FE_RESET_R                                           $6      !0, ->19
          4    > > FE_FETCH_R                                           ~7      $6, !2, ->19
          5    >   ASSIGN                                                       !3, ~7
   20     6        BOOL                                                 ~9      !2
          7        TYPE_CHECK                                        4          ~9
          8      > JMPZ                                                         ~10, ->14
   21     9    >   INIT_FCALL                                                   'printf'
         10        SEND_VAL                                                     '%25s+is+false%0A'
         11        SEND_VAR                                                     !3
         12        DO_ICALL                                                     
   20    13      > JMP                                                          ->18
   23    14    >   INIT_FCALL                                                   'printf'
         15        SEND_VAL                                                     '%25s+is+not+false%0A'
         16        SEND_VAR                                                     !3
         17        DO_ICALL                                                     
   19    18    > > JMP                                                          ->4
         19    >   FE_FREE                                                      $6
   27    20        ECHO                                                         'These+should+be+true%3A%0A'
   28    21      > FE_RESET_R                                           $13     !1, ->37
         22    > > FE_FETCH_R                                           ~14     $13, !2, ->37
         23    >   ASSIGN                                                       !3, ~14
   29    24        BOOL                                                 ~16     !2
         25        TYPE_CHECK                                        8          ~16
         26      > JMPZ                                                         ~17, ->32
   30    27    >   INIT_FCALL                                                   'printf'
         28        SEND_VAL                                                     '%25s+is+true%0A'
         29        SEND_VAR                                                     !3
         30        DO_ICALL                                                     
   29    31      > JMP                                                          ->36
   32    32    >   INIT_FCALL                                                   'printf'
         33        SEND_VAL                                                     '%25s+is+not+true%0A'
         34        SEND_VAR                                                     !3
         35        DO_ICALL                                                     
   28    36    > > JMP                                                          ->22
         37    >   FE_FREE                                                      $13
   34    38      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
176.59 ms | 3439 KiB | 14 Q