Re: [PATCH] Notice on array to string convertion

From: Date: Fri, 03 Jun 2011 07:43:03 +0000
Subject: Re: [PATCH] Notice on array to string convertion
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, Jun 3, 2011 at 1:05 AM, Arvids Godjuks <[email protected]>wrote:

> +1 on E_NOTICE
>  02.06.2011 19:13 пользователь "Ilia Alshanetsky"
> <[email protected]>
> написал:
> > I like the idea of an error message when this happens, but as few
> > other people in the thread had mentioned, I think it should be a
> > warning (E_WARNING) because the conversion results in data loss
> > (content of the array is replaced with "Array" string).
> >
> > On Thu, Jun 2, 2011 at 12:11 PM, Patrick ALLAERT <[email protected]
> >
> wrote:
> >> Hi,
> >>
> >> I would like to introduce an E_NOTICE when an array is silently
> >> converted to a string.
> >> This isn't very useful as it constantly produces the following string:
> >> "Array" and in most of the case, this is a sign of an error.
> >>
> >> Let me know about your feelings.
> >>
> >> Patch implementing that behavior change:
> https://gist.github.com/1004203
> >> Patch to adapt the tests: https://gist.github.com/1004204
> >>
> >> Cheers,
> >> Patrick
> >>
> >> --
> >> PHP Internals - PHP Runtime Development Mailing List
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

+1 for E_WARNING

Tyrael


Thread (72 messages)

« previous php.internals (#52836) next »