В чём отличие между count и sizeof?
php-src/ext/standard/basic_functions.c/* aliases from array.c */
PHP_FALIAS(sizeof, count, arginfo_count)$a = [1, 2];countnumber of ops:  5
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   5     1        INIT_FCALL                                               'count'
         2        SEND_VAR                                                 !0
         3        DO_ICALL
   7     4      > RETURN                                                   1

branch: #  0; line:     3-    7; sop:     0; eop:     4; out1:  -2sizeof — Псевдоним count()number of ops:  5
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   6     1        INIT_FCALL                                               'sizeof'
         2        SEND_VAR                                                 !0
         3        DO_ICALL
   7     4      > RETURN                                                   1

branch: #  0; line:     3-    7; sop:     0; eop:     4; out1:  -2
Практически sizeof быстрее чем count, доказательство?
документацию читали?
и коммент:
1/ prefer the count() function instead of sizeOf() as sizeOf() is only an alias of count() and does not mean the same in many other languages based on C (avoid ambiguity).
2/ prefer the powerful forEach() function to iterate over arrays.