think of one.
John Crenshaw
Priacta, Inc.
-Original Message-
From: Johannes Schlüter [mailto:johan...@schlueters.de]
Sent: Saturday, June 04, 2011 8:46 PM
To: Pierre Joye
Cc: Patrick ALLAERT; PHP Development
Subject: Re: [PHP-DEV] [PATCH] Notice on array to string convertion
On Thu, 2011
On Thu, 2011-06-02 at 15:29 +0200, Pierre Joye wrote:
> hi,
>
> I like this for the current stable branch, no bc impact and gives a
> way to detect such mistakes (not ideal but better than nothing).
This has an BC impact. some stupid error handler might be triggered
which might break an applicati
I think for consistency's sake it should be a notice as the same is already
done in _convert_to_string(). In fact, couldn't zend_make_printable_zval() use
_convert_to_string()?
- David
On 03.06.2011, at 09:57, Derick Rethans wrote:
> On Thu, 2 Jun 2011, Ilia Alshanetsky wrote:
>
>> I like th
2011/6/2 Ilia Alshanetsky :
> 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).
My initial
On Thu, 2 Jun 2011, Ilia Alshanetsky wrote:
> 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" stri
On Fri, Jun 3, 2011 at 1:05 AM, Arvids Godjuks wrote:
> +1 on E_NOTICE
> 02.06.2011 19:13 пользователь "Ilia Alshanetsky"
> написал:
> > 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)
+1 on E_NOTICE
02.06.2011 19:13 пользователь "Ilia Alshanetsky"
написал:
> 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
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 ALLAER
2011/6/2 Reindl Harald :
> Am 02.06.2011 16:24, schrieb Marcel Esser:
>> I am not convinced that making this an error is a good idea.
>>
>> If I receive a $_GET/$_POST value that I expect to be a string value, but I
>> actually received an array, this would
>> mean I need to now explicitly check f
may I suggest to both of you to continue this rant off line please?
The initial question was rather simple and only about this specific
case. And we seem to agree on the necessity to have a notice/warning
here. That's the maximum we can do at this stage, both for 5.3 and
5.4.
On Thu, Jun 2, 2011
I'm pretty sure you've never seen my code, so I am not going to comment
on that.
However, speaking not just for myself, two ternary operations and two
functions calls to just prevent a stoppage code of execution, never mind
input filtering for a second, is not entirely reasonable considering t
Am 02.06.2011 17:01, schrieb Peter Lind:
> On 2 June 2011 16:50, Reindl Harald wrote:
>> Am 02.06.2011 16:24, schrieb Marcel Esser:
>>> I am not convinced that making this an error is a good idea.
>>>
>>> If I receive a $_GET/$_POST value that I expect to be a string value, but I
>>> actually re
I agree entirely.
Let me go ahead and fix these three billion man hours worth of code in
use through-out the world. I'll be back shortly.
- M.
On 6/2/2011 11:19 AM, Reindl Harald wrote:
first rule of programming: sanitize user input
if you EXPECT no array catch it
Am 02.06.2011 16:54, schri
On Jun 2, 2011, at 8:01 AM, Peter Lind wrote:
> On 2 June 2011 16:50, Reindl Harald wrote:
>>
>>
>> Am 02.06.2011 16:24, schrieb Marcel Esser:
>>> I am not convinced that making this an error is a good idea.
>>>
>>> If I receive a $_GET/$_POST value that I expect to be a string value, but I
first rule of programming: sanitize user input
if you EXPECT no array catch it
Am 02.06.2011 16:54, schrieb Marcel Esser:
> You don't need a form to receive bad user input.
>
> Also, I am not really inclined to write $v = isset($_POST['x']) ?
> (is_array($_POST['x']) ? 'something else that
> mak
> Am 02.06.2011 14:56, schrieb Rune Kaagaard:
>>> this conversion should never happen and throw a fatal error since this
>>> action is destructive to data and never useful nor will warnings/notices
>>> helps in the real world
I agree totally that such a conversion should never happen. If we could
On 2 June 2011 16:50, Reindl Harald wrote:
>
>
> Am 02.06.2011 16:24, schrieb Marcel Esser:
>> I am not convinced that making this an error is a good idea.
>>
>> If I receive a $_GET/$_POST value that I expect to be a string value, but I
>> actually received an array, this would
>> mean I need to
You don't need a form to receive bad user input.
Also, I am not really inclined to write $v = isset($_POST['x']) ?
(is_array($_POST['x']) ? 'something else that makes more sense' :
$_POST['x'] ) : null; just to avoid catching a fatal.
- M.
On 6/2/2011 10:50 AM, Reindl Harald wrote:
Am 02.
Am 02.06.2011 16:24, schrieb Marcel Esser:
> I am not convinced that making this an error is a good idea.
>
> If I receive a $_GET/$_POST value that I expect to be a string value, but I
> actually received an array, this would
> mean I need to now explicitly check for it, since it will stop the
The choice between E_WARNING and E_NOTICE is simple if we look at the
definitions of the levels
(http://php.net/manual/en/errorfunc.constants.php).
E_NOTICE is defined as "Run-time notices. Indicate that the script
encountered something that could indicate an error, but could also
happen in the no
+1
Sent from my iPhone
On Jun 2, 2011, at 4:19 AM, Patrick ALLAERT 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
On Thu, 02 Jun 2011 15:38:00 +0200, Brian Moon wrote:
I like this for the current stable branch, no bc impact and gives a
way to detect such mistakes (not ideal but better than nothing).
On Thu, Jun 2, 2011 at 12:11 PM, Patrick
ALLAERT wrote:
Hi,
I would like to introduce an E_NOTICE when
I am not convinced that making this an error is a good idea.
If I receive a $_GET/$_POST value that I expect to be a string value,
but I actually received an array, this would mean I need to now
explicitly check for it, since it will stop the runtime otherwise. Example:
http://home.sweet.home
On Thu, Jun 02, 2011 at 04:07:25PM +0200, Patrick ALLAERT wrote:
> Not true. Here is a valid example that would break after implementing
> this as en error.
>
> if ("$x" == "Array") {
> array_walk( $x, "print_r" );
> }
>
> I'm not saying that this is good code, I'm only saying that this woul
2011/6/2 Brian Moon :
>> I like this for the current stable branch, no bc impact and gives a
>> way to detect such mistakes (not ideal but better than nothing).
>>
>> On Thu, Jun 2, 2011 at 12:11 PM, Patrick ALLAERT
>> wrote:
>>>
>>> Hi,
>>>
>>> I would like to introduce an E_NOTICE when an array
2011/6/2 Reindl Harald :
>
>
> Am 02.06.2011 15:04, schrieb John LeSueur:
>> On Thu, Jun 2, 2011 at 6:24 AM, Reindl Harald wrote:
>> First, I agree that converting to json/imploding would be a bad idea.
>> There's no guarantee that the developer wanted to use the array in that way,
>> or even
>> t
I like this for the current stable branch, no bc impact and gives a
way to detect such mistakes (not ideal but better than nothing).
On Thu, Jun 2, 2011 at 12:11 PM, Patrick ALLAERT wrote:
Hi,
I would like to introduce an E_NOTICE when an array is silently
converted to a string.
This isn't ver
2011/6/2 Rune Kaagaard :
>> this conversion should never happen and throw a fatal error since this
>> action is destructive to data and never useful nor will warnings/notices
>> helps in the real world
>
> Unlike i.e. Python its really not the PHP way to go fatal on the
> developer during weird typ
hi,
I like this for the current stable branch, no bc impact and gives a
way to detect such mistakes (not ideal but better than nothing).
Cheers,
On Thu, Jun 2, 2011 at 12:11 PM, Patrick ALLAERT wrote:
> Hi,
>
> I would like to introduce an E_NOTICE when an array is silently
> converted to a str
2011/6/2 Hannes Magnusson :
> How about making it useful rather then just throwing an notice?
> Recursive implode maybe? Or json/php serialized? :)
As already mentioned, that would be a much bigger BC break which would
requires RFC, voting, ...
Not that I am against, the thing is that it is diffi
LeSueur [mailto:john.lesu...@gmail.com]
Sent: Thursday, June 02, 2011 9:04 AM
To: Reindl Harald
Cc: internals@lists.php.net
Subject: Re: [PHP-DEV] [PATCH] Notice on array to string convertion
On Thu, Jun 2, 2011 at 6:24 AM, Reindl Harald wrote:
>
>
> Am 02.06.2011 13:54, schrieb Hannes
<3 yes please.
Sent from my iBrain, powered by Panda.
On Jun 2, 2011, at 6:19 AM, "Patrick ALLAERT" 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 i
Am 02.06.2011 15:04, schrieb John LeSueur:
> On Thu, Jun 2, 2011 at 6:24 AM, Reindl Harald wrote:
> First, I agree that converting to json/imploding would be a bad idea.
> There's no guarantee that the developer wanted to use the array in that way,
> or even
> that he wanted to use the array at
On Thu, Jun 2, 2011 at 6:24 AM, Reindl Harald wrote:
>
>
> Am 02.06.2011 13:54, schrieb Hannes Magnusson:
> > On Thu, Jun 2, 2011 at 12:11, Patrick ALLAERT
> wrote:
> >> Hi,
> >>
> >> I would like to introduce an E_NOTICE when an array is silently
> >> converted to a string.
> >> This isn't very
Am 02.06.2011 14:56, schrieb Rune Kaagaard:
>> this conversion should never happen and throw a fatal error since this
>> action is destructive to data and never useful nor will warnings/notices
>> helps in the real world
>
> Unlike i.e. Python its really not the PHP way to go fatal on the
> deve
> this conversion should never happen and throw a fatal error since this
> action is destructive to data and never useful nor will warnings/notices
> helps in the real world
Unlike i.e. Python its really not the PHP way to go fatal on the
developer during weird type conversions. I'm also +1 on the
Am 02.06.2011 13:54, schrieb Hannes Magnusson:
> On Thu, Jun 2, 2011 at 12:11, Patrick ALLAERT 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
Em Thu, 02 Jun 2011 12:54:10 +0100, Hannes Magnusson
escreveu:
On Thu, Jun 2, 2011 at 12:11, Patrick ALLAERT
wrote:
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 m
I don't there's a good general case for this. I'd +1 on throwing E_NOTICE.
Hannes
On 2 June 2011 13:54, Hannes Magnusson wrote:
>
> How about making it useful rather then just throwing an notice?
> Recursive implode maybe? Or json/php serialized? :)
>
> -Hannes
>
> --
> PHP Internals - PHP Runt
On Thu, Jun 2, 2011 at 12:11, Patrick ALLAERT 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.
How abou
Am 02.06.2011 12:19, schrieb Patrick ALLAERT:
> I would like to introduce an E_NOTICE when an array is silently
> converted to a string.
what is new?
a fatal error would be better here
error_reporting = E_ALL | E_STRICT
google: "Notice: Array to string conversion"
signature.asc
Description: Op
On Thu, Jun 02, 2011 at 12:19:36PM +0200, Patrick ALLAERT 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
42 matches
Mail list logo