Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Arnaud.lb
Should really theses functions discard the whole string for a single incomplete sequence ? I think since it is not possible to recover true content of the string, it is ok to return failure value. Cutting it in random places or ignoring problems doesn't seem a good idea - it might lead

[PHP-DEV] CVS Account Request: ignore_this

2008-01-26 Thread Felipe Pena
Hello, I would like karma to commit bugfixes in php-src. (i'd send patches) Actually i have access to phpdoc, phpdoc-langs. My cvs id: felipe -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Sebastian
hi, i just found the new ifsetor like construction in php6. It left me the question why php has to throw an E_NOTICE when the variable is not set. This is basicly because that actually is the meaning of this construction, checking if the variable is set and if it isnt give back a standard

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Sam Barrow
I'm sorry I misunderstood. If specifying like $var ?: 5 then it should throw an E_NOTICE, as this is a conditional that checks the value of a variable ($var). Sebastian, for assigning of a default value is a variable is not set, I would recommend using something like this (this is what I use):

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Sam Barrow
I don't think throwing a E_NOTICE is appropriate. The isset() construct doesn't throw an E_NOTICE, this shouldn't either. On Sat, 2008-01-26 at 17:30 +0100, Sebastian wrote: hi, i just found the new ifsetor like construction in php6. It left me the question why php has to throw an E_NOTICE

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Stefan Walk
On Saturday 26 January 2008 18:22:09 Sam Barrow wrote: I'm sorry I misunderstood. If specifying like $var ?: 5 then it should throw an E_NOTICE, as this is a conditional that checks the value of a variable ($var). Sebastian, for assigning of a default value is a variable is not set, I would

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Etienne Kneuss
Hi, usage of references here have some bad consequences, it will pollute the input array with null entries: function foo($a) { } var_dump(array_key_exists('inexistent', $_GET)); // bool(false) foo($_GET['inexistent']); var_dump(array_key_exists('inexistent', $_GET)); // bool(true) will actually

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Hannes Magnusson
On Jan 26, 2008 5:30 PM, Sebastian [EMAIL PROTECTED] wrote: hi, i just found the new ifsetor like construction in php6. (FYI: It has already been merged to 5.3) -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Lars Strojny
Hi, Am Samstag, den 26.01.2008, 12:17 -0500 schrieb Sam Barrow: I don't think throwing a E_NOTICE is appropriate. The isset() construct doesn't throw an E_NOTICE, this shouldn't either. As far as I understand it is just an extension to the already present tertiary operator and therefore the

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Robert Cummings
On Sat, 2008-01-26 at 22:13 +0100, Lars Strojny wrote: Hi, Am Samstag, den 26.01.2008, 12:17 -0500 schrieb Sam Barrow: I don't think throwing a E_NOTICE is appropriate. The isset() construct doesn't throw an E_NOTICE, this shouldn't either. As far as I understand it is just an

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Johannes Schlüter
Hi, On Sat, 2008-01-26 at 16:23 -0500, Robert Cummings wrote: And I thought the whole point was for it to not generate a notice. Isn't that why the name ifsetor was chosen? Since it's supposed to work like isset() by not generating notices? This thing is not called ifsetor. From the commit

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Lars Strojny
Hi, Am Samstag, den 26.01.2008, 16:23 -0500 schrieb Robert Cummings: [...] This doesn't work how you think... if $_GET['foo'] is set then the return value is true and not the value of $_GET['foo']. Hm, check what happens: $b = array(false, false); var_dump($b[0] ?: sdf); This will return

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Lars Strojny
Hi, Am Samstag, den 26.01.2008, 22:43 +0100 schrieb Johannes Schlüter: [...] ?: operator [DOC] expr1 ?: expr1 is a shortcut for: expr1 ? expr1 : expr2 as exists in gcc and discussed some time back. Note that this is not an implementation ifsetor($var, default). While ifsetor would not

Re: [PHP-DEV] ifsetor like expression in php6

2008-01-26 Thread Sam Barrow
On Sat, 2008-01-26 at 22:13 +0100, Lars Strojny wrote: Hi, Am Samstag, den 26.01.2008, 12:17 -0500 schrieb Sam Barrow: I don't think throwing a E_NOTICE is appropriate. The isset() construct doesn't throw an E_NOTICE, this shouldn't either. As far as I understand it is just an

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Stanislav Malyshev
Instead of using simple sanitizing function users are forced to check for errors. How good is that? It makes code complex or unreliable. Explain me again how checking for errors makes code unreliable? -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/

Re: [PHP-DEV] early class binding revisited

2008-01-26 Thread phpxcache
any news on this topic? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Tomas Kuliavas
Instead of using simple sanitizing function users are forced to check for errors. How good is that? It makes code complex or unreliable. Explain me again how checking for errors makes code unreliable? OR unreliable. If you check for errors, sanitizing code is complex. If you don't check and