Chen Ze | 1 May 2010 01:51
Picon

[PHP-DEV] cn.php.net/FAQ.php not works

sorry, I know here is not the right place to post this. I subscribed
to Webmaster discussion mailling list, but no mail was sent to me. so
I need to post in other lists I joined.

ok, the problem is that http://cn.php.net/FAQ.php not works as other
mirrors like http://au.php.net/FAQ.php. I contacted the webmaster of
cn.php.net, but he told me he just followed the instruction of
http://cn.php.net/mirroring.php.

so what is the problem? Is it need to ln or rewrite something?

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Brian Moon | 3 May 2010 00:53
Gravatar

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

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.

A) Has this been discussed?
B) If not, do others think it is worth of a proper RFC?

There would be some BC breakage for sure as the default behavior would 
be changing.

-- 

Brian.
--------
brianlmoon <at> php.net

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

mathieu.suen | 3 May 2010 15:01
Favicon
Gravatar

[PHP-DEV] Closure local return

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 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

So  I am asking if there has been some discussion on it or if it could 
be  added?

Thanks

--Mathieu Suen

	

Jille Timmermans | 3 May 2010 15:27
Gravatar

Re: [PHP-DEV] Closure local return

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).
>
> 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
>
> So I am asking if there has been some discussion on it or if it could be
> added?
>
> Thanks
>
> --Mathieu Suen
>
>
>
>
(Continue reading)

Etienne Kneuss | 3 May 2010 15:33
Picon

Re: [PHP-DEV] Closure local return

Hello,

On Mon, May 3, 2010 at 3:01 PM, mathieu.suen <mathieu.suen <at> 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 closure is create (define
> scope).
>
> 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

uh? Could you please provide a clear example of what you mean, in
contrast of how it works now.

"return" returns to just after the call, returning somewhere else
doesn't make much sense IMHO.

>
> So  I am asking if there has been some discussion on it or if it could be
>  added?
>
(Continue reading)

mathieu.suen | 3 May 2010 16:17
Favicon
Gravatar

Re: [PHP-DEV] Closure local return

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 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 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
>>
>> So I am asking if there has been some discussion on it or if it could be
>> added?
>>
(Continue reading)

Christian Schneider | 3 May 2010 17:42

[PHP-DEV] Re: Closure local return

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 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, it doesn't make sense in the PHP context IMHO.

- Chris

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Lukas Kahwe Smith | 3 May 2010 17:44

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


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.
> 
> A) Has this been discussed?
> B) If not, do others think it is worth of a proper RFC?
> 
> There would be some BC breakage for sure as the default behavior would be changing.

Due to this BC and the fact that I do not see this as a super pressing issue, I would hold off with doing this
change until we have our unicode plans more concrete, because this might result in yet another change in
this area.

regards,
Lukas Kahwe Smith
mls <at> pooteeweet.org

PS: Then again .. the entire unicode discussion seems to have died on this list and I am not aware of any
documentation having been made or any other tangible progress.

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

mathieu.suen | 3 May 2010 17:54
Favicon
Gravatar

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


> 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, it doesn't make sense in the PHP context IMHO.
>
> - Chris
>
>    
"returns from the closure function"
To go were?

I had maintain a smalltalk compiler.
I did not misunderstand the difference.

The Common Lisp implementation is the more explicit one.
For exemple:

(defun eval-l1 (fct) (funcall fct))
(defun bar (x) (eval-l1 #'(lambda () (return-from bar 45)))
                         x)

(bar 23) -> 45

When funcall is apply you do not return from eval-l1. You return from bar.
Which is the defining scope of the lanbda.

(Continue reading)

Etienne Kneuss | 3 May 2010 18:03
Picon

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

On Mon, May 3, 2010 at 5:54 PM, mathieu.suen <mathieu.suen <at> 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
>> function or the surrounding function *calling* it. Not the *defining*
>> scope.
>>
>> And no, it doesn't make sense in the PHP context IMHO.
>>
>> - Chris
>>
>>
>
> "returns from the closure function"
> To go were?
>
> I had maintain a smalltalk compiler.
> I did not misunderstand the difference.
>
> The Common Lisp implementation is the more explicit one.
> For exemple:
>
> (defun eval-l1 (fct) (funcall fct))
> (defun bar (x) (eval-l1 #'(lambda () (return-from bar 45)))
>                        x)
>
> (bar 23) -> 45
(Continue reading)


Gmane