3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("", "", "", "", "", "", ""); function arrayIsEmpty ($arr) { $emptyCount = 0; foreach ($arr as $item) { if (empty($item)) { $emptyCount++; } } return $emptyCount === count($arr); } var_dump(count($arr));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqpKl
function name:  (null)
number of ops:  6
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'var_dump'
          2        COUNT                                            ~2      !0
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function arrayisempty:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/sqpKl
function name:  arrayIsEmpty
number of ops:  13
compiled vars:  !0 = $arr, !1 = $emptyCount, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, 0
    7     2      > FE_RESET_R                                       $4      !0, ->8
          3    > > FE_FETCH_R                                               $4, !2, ->8
    8     4    >   ISSET_ISEMPTY_CV                                         !2
          5      > JMPZ                                                     ~5, ->7
    9     6    >   PRE_INC                                                  !1
    7     7    > > JMP                                                      ->3
          8    >   FE_FREE                                                  $4
   13     9        COUNT                                            ~7      !0
         10        IS_IDENTICAL                                     ~8      !1, ~7
         11      > RETURN                                                   ~8
   14    12*     > RETURN                                                   null

End of function arrayisempty

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.27 ms | 1395 KiB | 15 Q