Re: Re: Fwd: Re: #25494 [Com]: array_merge allowing "false" as argument (silent when non-array is passed)

From: Date: Wed, 08 Oct 2003 00:36:11 +0000
Subject: Re: Re: Fwd: Re: #25494 [Com]: array_merge allowing "false" as argument (silent when non-array is passed)
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-4736@lists.php.net to get a copy of this message
On October 7, 2003 08:19 pm, Jon Parise wrote: > By your definition, the code was "proper" (i.e. did not generate > warnings) until the underlying rules were changed, and I'm sure we all > agree that that's a silly definition of "proper code". Well, you are claiming that a code that relies on an illogical and undocumented 'feature' is proper? The function documentation both in the manual & the php source comments clearly stated the the only acceptable arguments for the function are arrays. Had someone for whatever reasons converted the function to use new argument parsing API the same thing would've happened. So, unless you would like to argue that PHP's argument parsing is wrong this is not a bug. Even if we were to take other array functions into consideration, you'd notice that they would return E_WARNING let a lone a harmless E_NOTICE (blocked by most people) when passed a variable of an incorrect type. PEAR is the official PHP library, which many people will undoubtedly use to learn by example. IMHO that means that PEAR libraries especially the ones part of the 'core' (automatically distributed) packages contain exemplary code other people can safely learn from? Ilia

« previous php.internals (#4736) next »