[PHP-DEV] Closure local return

2010-05-03 Thread mathieu.suen
Hi, The statement 'return' in a closure is now returning from the scope that evaluate the closure (evaluation scope). It could have been in an other way. It could mean return from the scope were the closure is create (define scope). May be it could be interesting to have a syntax for

Re: [PHP-DEV] Closure local return

2010-05-03 Thread Jille Timmermans
Are you serious? Op 3-5-2010 15:01, mathieu.suen schreef: Hi, The statement 'return' in a closure is now returning from the scope that evaluate the closure (evaluation scope). It could have been in an other way. It could mean return from the scope were the closure is create (define scope).

Re: [PHP-DEV] Closure local return

2010-05-03 Thread Etienne Kneuss
Hello, On Mon, May 3, 2010 at 3:01 PM, mathieu.suen mathieu.s...@easyflirt.com wrote: Hi, The statement 'return' in a closure is now returning from the scope that evaluate the closure (evaluation scope). It could have been in an other way. It could mean return from the  scope were the

Re: [PHP-DEV] Closure local return

2010-05-03 Thread mathieu.suen
Of course I am. take a look at: http://en.wikipedia.org/wiki/Closure_%28computer_science%29 Section: Differences in semantics On 05/03/2010 03:27 PM, Jille Timmermans wrote: Are you serious? Op 3-5-2010 15:01, mathieu.suen schreef: Hi, The statement 'return' in a closure is now returning

[PHP-DEV] Re: Closure local return

2010-05-03 Thread Christian Schneider
mathieu.suen wrote: May be it could be interesting to have a syntax for returning from the define scope. For example. $findedElment = $myList-selectIfAbsent($fooo, function(){ return 'No item founded'; //Retrun from the define scope }) //Do somthing with $findedElment I think you

Re: [PHP-DEV] Using default_charset for htmlspecialchars() and others

2010-05-03 Thread Lukas Kahwe Smith
On 03.05.2010, at 00:53, Brian Moon wrote: I am not sure if this has been discussed or not. I will gladly make an RFC if not. I think it would be very intuitive if htmlspecialchars used the ini value default_charset as its default. And any function that takes an optional character set.

Re: [PHP-DEV] Re: Closure local return

2010-05-03 Thread mathieu.suen
I think you actually misunderstand the difference in http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Differences_in_semantics The way I read if the difference is wether it returns from the closure function or the surrounding function *calling* it. Not the *defining* scope. And no,

Re: [PHP-DEV] Re: Closure local return

2010-05-03 Thread Etienne Kneuss
On Mon, May 3, 2010 at 5:54 PM, mathieu.suen mathieu.s...@easyflirt.com wrote: I think you actually misunderstand the difference in http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Differences_in_semantics The way I read if the difference is wether it returns from the closure

Re: [PHP-DEV] Re: Closure local return

2010-05-03 Thread Tjerk Anne Meesters
On Mon, May 3, 2010 at 11:42 PM, Christian Schneider cschn...@cschneid.com wrote: mathieu.suen wrote: May be it could be interesting to have a syntax for returning from the define scope. For example. $findedElment = $myList-selectIfAbsent($fooo, function(){     return 'No item founded';

[PHP-DEV] Autoboxing in PHP

2010-05-03 Thread Moriyoshi Koizumi
Hey, Just to let you know about a new RFC for adding autoboxing feature in PHP. Look at http://wiki.php.net/rfc/autoboxing . Regards, Moriyoshi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Using default_charset for htmlspecialchars() and others

2010-05-03 Thread Moriyoshi Koizumi
Hi, I am under the impression that we have to provide an alternative to htmlspecialchars() that incorporates the following ideas: - Shorter function name html_escape() for example. _h() would be much more preferable in terms of preventing XSS ;-p - Using default_charset as the default encoding