PHP Sadness

(<5.6) The array_fill() function doesn't allow length 0

$ php -r 'var_dump(array_fill(0,0,"a"));'
PHP Warning:  array_fill(): Number of elements must be positive in Command line code on line 1
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. array_fill() Command line code:1
bool(false)

php array_fill should return an empty array for length 0. This is useful when used in a function where the length parameter is not known ahead of time and will sometimes be zero, like when building argument arrays to functions which may or may not take any arguments at all.

Significance: Consistency

Language consistency is very important for developer efficiency. Every inconsistent language feature means that developers have one more thing to remember, one more reason to rely on the documentation, or one more situation that breaks their focus. A consistent language lets developers create habits and expectations that work throughout the language, learn the language much more quickly, more easily locate errors, and have fewer things to keep track of at once.