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 smalys...@sugarcrm.com wrote: Hi! Hi:   like the following script:   ?php $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

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 larue...@php.net wrote: On Mon, Oct 31, 2011 at 10:55 AM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! Hi:   like the following script:   ?php $str = (string)array(); echo $str;    it is obviously intentionally convert a array to string ,  

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 smalys...@sugarcrm.com 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

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

2011-11-02 Thread Patrick ALLAERT
2011/11/2 Etienne Kneuss col...@php.net: Hi, On Wed, Nov 2, 2011 at 17:27, Stas Malyshev smalys...@sugarcrm.com 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

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 patrickalla...@php.net 写道: 2011/11/2 Etienne Kneuss col...@php.net: Hi, On Wed, Nov 2,

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

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 larue...@php.net: 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

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

2011-10-30 Thread Laruence
Hi: like the following script: ?php $str = (string)array(); echo $str; it is obviously intentionally convert a array to string , but the warning is coming: PHP Notice: Array to string conversion in /tmp/1.php on line 2 so I think maybe this change is a little radical, thanks

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: ?php $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: 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 j.boggi...@seld.be: On 30.10.2011 13:19, Laruence

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

2011-10-30 Thread Laruence
s /second/third/ 2011/10/30 Laruence larue...@php.net: 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

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 larue...@php.net 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

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

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 larue...@php.net 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

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

2011-10-30 Thread Stas Malyshev
Hi! Hi: like the following script: ?php $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. This code is an extremely convoluted way to write echo 'Array'; and as

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 smalys...@sugarcrm.com: Hi! Hi:   like the following script:   ?php

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

2011-10-19 Thread Patrick ALLAERT
2011/10/18 Stas Malyshev smalys...@sugarcrm.com: 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

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

2011-10-19 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:

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

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

[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

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

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

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

2011-06-06 Thread Matthew Weier O'Phinney
On 2011-06-02, Patrick ALLAERT patrickalla...@php.net 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

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 patrickalla...@php.net 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

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 i...@tyrael.hu 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 patrickalla...@php.net wrote: I would like to

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 i...@tyrael.hu 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