3v4l.org

run code in 500+ PHP versions simultaneously
<?php echo "Non-existent: ", json_encode(!isset($var) || !($var || (is_scalar($var) && strlen($var)))), "\n"; $values = [null, false, true, 0, 100, "", "string", [], [0]]; foreach ($values as $var) { echo json_encode($var), ": ", json_encode(!isset($var) || !($var || (is_scalar($var) && strlen($var)))), "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 42
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 42
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 29, Position 2 = 37
Branch analysis from position: 29
2 jumps found. (Code = 47) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 34
Branch analysis from position: 35
Branch analysis from position: 37
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 10
Branch analysis from position: 11
Branch analysis from position: 13
filename:       /in/WLQ0D
function name:  (null)
number of ops:  44
compiled vars:  !0 = $var, !1 = $values
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                         'Non-existent%3A+'
          1        INIT_FCALL                                                   'json_encode'
          2        ISSET_ISEMPTY_CV                                     ~2      !0
          3        BOOL_NOT                                             ~3      ~2
          4      > JMPNZ_EX                                             ~3      ~3, ->13
          5    > > JMPNZ_EX                                             ~4      !0, ->11
          6    >   TYPE_CHECK                                      124  ~5      !0
          7      > JMPZ_EX                                              ~5      ~5, ->10
          8    >   STRLEN                                               ~6      !0
          9        BOOL                                                 ~5      ~6
         10    >   BOOL                                                 ~4      ~5
         11    >   BOOL_NOT                                             ~7      ~4
         12        BOOL                                                 ~3      ~7
         13    >   SEND_VAL                                                     ~3
         14        DO_ICALL                                             $8      
         15        ECHO                                                         $8
         16        ECHO                                                         '%0A'
    3    17        ASSIGN                                                       !1, <array>
    4    18      > FE_RESET_R                                           $10     !1, ->42
         19    > > FE_FETCH_R                                                   $10, !0, ->42
    5    20    >   INIT_FCALL                                                   'json_encode'
         21        SEND_VAR                                                     !0
         22        DO_ICALL                                             $11     
         23        ECHO                                                         $11
         24        ECHO                                                         '%3A+'
         25        INIT_FCALL                                                   'json_encode'
         26        ISSET_ISEMPTY_CV                                     ~12     !0
         27        BOOL_NOT                                             ~13     ~12
         28      > JMPNZ_EX                                             ~13     ~13, ->37
         29    > > JMPNZ_EX                                             ~14     !0, ->35
         30    >   TYPE_CHECK                                      124  ~15     !0
         31      > JMPZ_EX                                              ~15     ~15, ->34
         32    >   STRLEN                                               ~16     !0
         33        BOOL                                                 ~15     ~16
         34    >   BOOL                                                 ~14     ~15
         35    >   BOOL_NOT                                             ~17     ~14
         36        BOOL                                                 ~13     ~17
         37    >   SEND_VAL                                                     ~13
         38        DO_ICALL                                             $18     
         39        ECHO                                                         $18
         40        ECHO                                                         '%0A'
    4    41      > JMP                                                          ->19
         42    >   FE_FREE                                                      $10
    6    43      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.91 ms | 1460 KiB | 14 Q