On Dec 20, 2007 7:02 PM, Sean Coates <[EMAIL PROTECTED]> wrote:
> Apart from saving a few keystrokes, the above could easily be changed
> to the following, which is much more clear, DOES compile at compile-
> time, and works without adding a new construct that looks like a
> closure, but is not indeed one:
>
> function aiusdyasdjkhasdIMASHEDTHEKEYBOARD($test){ return 3 === ($test
> % 4) }
> array_filter($my_data, 'aiusdyasdjkhasdIMASHEDTHEKEYBOARD');
>

I'm not sure. Are you using this as an argument _for_ or _against_?
Because to me, that looks ridiculous.

It won't work either. You have to add guards, to prevent a fatal
error, if you include the file twice. So the entire "solution" would
be:
if (!function_exists('aiusdyasdjkhasdIMASHEDTHEKEYBOARD')) {
  function aiusdyasdjkhasdIMASHEDTHEKEYBOARD($test){ return 3 === ($test % 4); }
}
array_filter($my_data, 'aiusdyasdjkhasdIMASHEDTHEKEYBOARD');

> At risk of wading into yet circular another discussion on internals@,
> I was part of the original thread on this subject, and I agree with
> Stas here: unless they're real closure, they're pretty useless.

I don't believe that has been Stanislavs point so far. As I understand
it, he says that adding the syntax, without adding closures, may
confuse people, who then will intuitively expect closures. That is not
the same as saying, it is useless.
On the point of uselessness, I have already explained how it would be
a useful construct.

On Dec 20, 2007 7:09 PM, Stanislav Malyshev <[EMAIL PROTECTED]> wrote:
> >   and you did it again :-) Not working? What the hell are you talking of?
> > We can easily make it working with whatever feature set we want. We do not
>
> We meaning who? I can't "easily" make closures working in PHP. And even
> if I could, I'm not sure I want to.

I agree fully. Static scope should not be implemented in PHP. Could we
discus the patch, rather than something, which is purely theoretical
and only marginally related?

--
troels

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

Reply via email to