Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Xinchen Hui
hi, we should only warn the un-intenional convertion . So , give third to send make printable zavl. Sppress all the intentional ones. Thanks Sent from my iPhone 在 2011-11-3,4:23,Patrick ALLAERT 写道: > 2011/11/2 Etienne Kneuss : >> Hi, >> >> On Wed, Nov 2, 2011 at 17:27, Stas Malyshev wr

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Patrick ALLAERT
2011/11/2 Etienne Kneuss : > Hi, > > On Wed, Nov 2, 2011 at 17:27, Stas Malyshev wrote: >> Hi! >> >>> 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

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Etienne Kneuss
Hi, On Wed, Nov 2, 2011 at 17:27, Stas Malyshev wrote: > Hi! > >> 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. > > That one would have the arrays

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Stas Malyshev
Hi! 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. That one would have the arrays different. Having multi-dimensonal arrays is not an error, comparing

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Etienne Kneuss
On Nov 2, 2011 4:05 PM, "Stas Malyshev" 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 obvio

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Stas Malyshev
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

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Etienne Kneuss
Hi, On Wed, Nov 2, 2011 at 09:55, Laruence wrote: > On Mon, Oct 31, 2011 at 10:55 AM, Stas Malyshev > wrote: >> Hi! >> >>> Hi: >>>   like the following script: >>>   >> $str = (string)array(); >>> echo $str; >>> >>>    it is obviously intentionally convert a array to string ,  but the >>> warni

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-11-02 Thread Laruence
On Mon, Oct 31, 2011 at 10:55 AM, Stas Malyshev wrote: > Hi! > >> Hi: >>   like the following script: >>   > $str = (string)array(); >> echo $str; >> >>    it is obviously intentionally convert a array to string ,  but the >> warning is coming: > > I think it's the correct way to react for PHP. Th

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
Hi: Actually, I only know two , one is in ext/reflection and another is 60174 I just fixed 60174 , but if there comes a new argument to zend_make_printable_zval , I will re-fix this . thanks 2011/10/31 Stas Malyshev : > Hi! > >> Hi: >>   like the following script: >>   > $str = (string)array(

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Stas Malyshev
Hi! Hi: like the following script: I think it's the correct way to react for PHP. This code is an extremely convoluted way to write "echo 'Array';" and as such doesn't seem to do anything useful. I have yet to see one single instance where converting array to string made any sense. Of

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Paul Dragoonis
On Mon, Oct 31, 2011 at 2:36 AM, Laruence wrote: > Paul: >    sure,  there is some usage in ext/reflection and what was said in > the bug report. > >    so if there is no a argument to suppress it,  these codes  have to > change to something like: understood. indeed doesn't seem quite right. On

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
Paul: sure, there is some usage in ext/reflection and what was said in the bug report. so if there is no a argument to suppress it, these codes have to change to something like: if (Z_TYPE_P(val) == IS_ARRAY) { } else { zend_make_printable_zval.. } which is ugly.

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Paul Dragoonis
On Sun, Oct 30, 2011 at 1:23 PM, Laruence wrote: > s /second/third/ Laurence, What Jordi was saying was that in a production environment is there any justified reason why you'd want to convert an array into a string, otherwise it's a good thing that it reports you "Array to string" as you've pro

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
s /second/third/ 2011/10/30 Laruence : > Hi: >    I don't think this(you think there is no use) can used for the > reason to do such a change. > >    actully I ask for a sencond argument for  zend_make_printable_zval >  to suppress the warning *intentionally*. > > thanks > > 2011/10/30 Jordi Boggi

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
Hi: I don't think this(you think there is no use) can used for the reason to do such a change. actully I ask for a sencond argument for zend_make_printable_zval to suppress the warning *intentionally*. thanks 2011/10/30 Jordi Boggiano : > On 30.10.2011 13:19, Laruence wrote: >> Hi: >>

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Jordi Boggiano
On 30.10.2011 13:19, Laruence wrote: > Hi: > like the following script: >$str = (string)array(); > echo $str; > >it is obviously intentionally convert a array to string , but the > warning is coming: It is obviously intentional but also obviously pointless. You might as well just echo

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
Hi: like the following script: : > here is the report #60174 > > thanks > > 2011/10/30 Laruence : >> Hi: >>   there is a bug report about this new change. >> >>   I found that there has added  a notice  to zend_make_printable_zval >> and without any parameter to suppress the warning. >> >>   I

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
here is the report #60174 thanks 2011/10/30 Laruence : > Hi: >   there is a bug report about this new change. > >   I found that there has added  a notice  to zend_make_printable_zval > and without any parameter to suppress the warning. > >   I think this is very bad, since zend_make_printable_zv

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Laruence
Hi: there is a bug report about this new change. I found that there has added a notice to zend_make_printable_zval and without any parameter to suppress the warning. I think this is very bad, since zend_make_printable_zval is used in internal when need to print some infos. so mayb

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-18 Thread Stas Malyshev
Hi! On 10/18/11 11:28 PM, Patrick ALLAERT wrote: I have not enough karma to change Zend/zend.c. Could you solve this please? Once solved I can push this to trunk and PHP_5_4. If you send me the patch I can apply it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-18 Thread Patrick ALLAERT
2011/10/18 Stas Malyshev : > Hi! > > On 10/17/11 6:01 AM, Patrick ALLAERT wrote: >>> >>> @Stas, DSP >>> Would you agree to merge this into PHP 5.4? >> >> *bump* > > Yes I think it's OK. I have not enough karma to change Zend/zend.c. Could you solve this please? Once solved I can push this to trun

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-17 Thread Stas Malyshev
Hi! On 10/17/11 6:01 AM, Patrick ALLAERT wrote: @Stas, DSP Would you agree to merge this into PHP 5.4? *bump* Yes I think it's OK. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To u

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-17 Thread Patrick ALLAERT
2011/6/20 Patrick ALLAERT : > 2011/6/2 Patrick ALLAERT : >> 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. >

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-20 Thread Patrick ALLAERT
2011/6/2 Patrick ALLAERT : > 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.

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-06 Thread Marcel Esser
On Mon, 2011-06-06 at 12:32 -0400, Matthew Weier O'Phinney wrote: > On 2011-06-06, Ferenc Kovacs wrote: > > --00261883a59c62fbe404a50bd89c > > Content-Type: text/plain; charset=UTF-8 > > > > On Mon, Jun 6, 2011 at 3:36 PM, Matthew Weier O'Phinney < > > weierophin...@php.net> wrote: > > > > > On 20

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-06 Thread Matthew Weier O'Phinney
On 2011-06-06, Ferenc Kovacs wrote: > --00261883a59c62fbe404a50bd89c > Content-Type: text/plain; charset=UTF-8 > > On Mon, Jun 6, 2011 at 3:36 PM, Matthew Weier O'Phinney < > weierophin...@php.net> wrote: > > > On 2011-06-02, Patrick ALLAERT wrote: > > > I would like to introduce an E_NOTICE when

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-06 Thread Ferenc Kovacs
On Mon, Jun 6, 2011 at 3:36 PM, Matthew Weier O'Phinney < weierophin...@php.net> wrote: > On 2011-06-02, 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:

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-06 Thread Matthew Weier O'Phinney
On 2011-06-02, 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 most of the case, this is a sign of an error. > > Let me know about your feelin