3v4l.org

run code in 300+ PHP versions simultaneously
<?php // count(false) analogous to count(array(false)) only // false is not cast to an array for counting // default return value is one when counting not null value // note array(null) not null! $a = (array) false; //echo $a; // can't display false cast as an array echo $a[0],"\n"; foreach ($a as $e) { echo $e,"\n"; } echo count(array(null));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/PG7DF
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   CAST                                          7  ~2      <false>
          1        ASSIGN                                                   !0, ~2
    8     2        FETCH_DIM_R                                      ~4      !0, 0
          3        ECHO                                                     ~4
          4        ECHO                                                     '%0A'
    9     5      > FE_RESET_R                                       $5      !0, ->10
          6    > > FE_FETCH_R                                               $5, !1, ->10
   10     7    >   ECHO                                                     !1
          8        ECHO                                                     '%0A'
    9     9      > JMP                                                      ->6
         10    >   FE_FREE                                                  $5
   12    11        COUNT                                            ~6      <array>
         12        ECHO                                                     ~6
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1393 KiB | 13 Q