3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (['', null, 0, 0.0, '0', false, [], new stdClass, 'foo', 1, true, ['bar' => 'baz']] as $val) { var_dump($val, count($val), !empty($val)); echo '-------------', PHP_EOL; } var_dump('undefined', count($undefined), !empty($undefined));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/SdPPI
function name:  (null)
number of ops:  37
compiled vars:  !0 = $val, !1 = $undefined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      ''
          1        ADD_ARRAY_ELEMENT                                ~2      null
          2        ADD_ARRAY_ELEMENT                                ~2      0
          3        ADD_ARRAY_ELEMENT                                ~2      0
          4        ADD_ARRAY_ELEMENT                                ~2      '0'
          5        ADD_ARRAY_ELEMENT                                ~2      <false>
          6        ADD_ARRAY_ELEMENT                                ~2      <array>
          7        NEW                                              $3      'stdClass'
          8        DO_FCALL                                      0          
          9        ADD_ARRAY_ELEMENT                                ~2      $3
         10        ADD_ARRAY_ELEMENT                                ~2      'foo'
         11        ADD_ARRAY_ELEMENT                                ~2      1
         12        ADD_ARRAY_ELEMENT                                ~2      <true>
         13        ADD_ARRAY_ELEMENT                                ~2      <array>
         14      > FE_RESET_R                                       $5      ~2, ->27
         15    > > FE_FETCH_R                                               $5, !0, ->27
    4    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        COUNT                                            ~6      !0
         19        SEND_VAL                                                 ~6
         20        ISSET_ISEMPTY_CV                                 ~7      !0
         21        BOOL_NOT                                         ~8      ~7
         22        SEND_VAL                                                 ~8
         23        DO_ICALL                                                 
    5    24        ECHO                                                     '-------------'
         25        ECHO                                                     '%0A'
    3    26      > JMP                                                      ->15
         27    >   FE_FREE                                                  $5
    8    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAL                                                 'undefined'
         30        COUNT                                            ~10     !1
         31        SEND_VAL                                                 ~10
         32        ISSET_ISEMPTY_CV                                 ~11     !1
         33        BOOL_NOT                                         ~12     ~11
         34        SEND_VAL                                                 ~12
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.07 ms | 1011 KiB | 14 Q