Re: Re: [PATCH] Notice on array to string convertion
| From: | Etienne Kneuss | Date: | Wed, 02 Nov 2011 15:39:16 +0000 |
| Subject: | Re: Re: [PATCH] Notice on array to string convertion | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56010@lists.php.net to get a copy of this message | ||
On Nov 2, 2011 4:05 PM, "Stas Malyshev" <smalyshev@sugarcrm.com> wrote:
>
> Hi!
>
>
>> In such cases, the notice actually seems fine to me. This is typically
>> the cases where you want to inform the user that he probably did
>> something wrong...
>
>
> In this specific case, I would say notice is not needed - it is obvious
that a string is not equal to any array, so there's no need to convert
anything if one of the variables is array and another is not - just
consider them not equal.
What about array_diff(array("Array"), array(array()))? To me the sole act
of having an array in it is an almost sure indication that the code is
wrong somewhere... IMO it deserves a notice.
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227