3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '0'; if ($str) { echo "option 1: not empty\n"; } if (strlen($str)) { echo "option 2: not empty\n"; } if (!empty($str)) { echo "option 3: not empty\n"; } if ($str !== '') { echo "option 4: not empty\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 10
Branch analysis from position: 6
Branch analysis from position: 3
filename:       /in/KneDV
function name:  (null)
number of ops:  14
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '0'
    4     1      > JMPZ                                                     !0, ->3
    5     2    >   ECHO                                                     'option+1%3A+not+empty%0A'
    8     3    >   STRLEN                                           ~2      !0
          4      > JMPZ                                                     ~2, ->6
    9     5    >   ECHO                                                     'option+2%3A+not+empty%0A'
   12     6    >   ISSET_ISEMPTY_CV                                 ~3      !0
          7        BOOL_NOT                                         ~4      ~3
          8      > JMPZ                                                     ~4, ->10
   13     9    >   ECHO                                                     'option+3%3A+not+empty%0A'
   16    10    >   IS_NOT_IDENTICAL                                         !0, ''
         11      > JMPZ                                                     ~5, ->13
   17    12    >   ECHO                                                     'option+4%3A+not+empty%0A'
   18    13    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.73 ms | 1394 KiB | 13 Q