Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Lenar Lõhmus
Hi, Rodrigo Saboya wrote: >> >> function ($x, $y) ($a, $b, $c) {}; > > This looks better > >> function ($x, $y) [$a, $b, $c] {}; I think this looks even better: function ($x, $y) use ($a, $b, &$c) {}; (one could use this syntax even for traditional functions to use variable copies/references f

Re: [PHP-DEV] [patch] re-invoking default error handler

2004-05-28 Thread Lenar Lõhmus
Sara Golemon wrote: > We don't necessarily *have* to. Unless people are explicitly returning a > false value (as opposed to simply not using return) we can make the > distinction. Recall that not returning anything is passed as a return > value > of NULL. So we could say "If NULL, don't invoke

Re: [PHP-DEV] [patch] re-invoking default error handler

2004-05-27 Thread Lenar Lõhmus
Jon Parise wrote: > The convention(*) for these kinds of things is generally to return > 'true' when you've handled the message/event and want to discontinue > further processing. Returning 'false' indicates that you haven't > handled the event. You are right. That's how it should be done. >> I

Re: [PHP-DEV] Studlycaps and MySQLi

2004-03-25 Thread Lenar Lõhmus
Nuno Lopes wrote: > > I really hate the Studlycaps convention. I prefer the old dash. Decision was made. > Why not use this only for new extensions? Do you know the pain to update > all the docs??... mysqli, tidy and sqlite are _new_ extensions. At least from the perspective of PHP's user. > >

Re: [PHP-DEV] error_handler

2003-12-19 Thread Lenar Lõhmus
Christian Schneider wrote: > Just checked it and no: set_error_handler does _not_ ignore the > additional parameter, it fails and does _not_ install the handler on > PHP4. Leave out E_ALL and it works like a charm. Am I missing something > here? > > Script used to test: > function handler() > { >

Re: [PHP-DEV] error_handler

2003-12-19 Thread Lenar Lõhmus
Christian Schneider wrote: > Ok, now realistically, how many people use error handlers, have > error_reporting != E_ALL *AND* expect their handler to be called for > E_ALL *AND* aren't savvy enough to simple set error_reporting to E_ALL? Even though I'm not one of them I'm told there are people w

Re: [PHP-DEV] error_handler

2003-12-19 Thread Lenar Lõhmus
> Please provide a real world example of why you would need version compare. I wouldn't :) > Error handlers written for PHP 4 (expecting that all errors will go to the > handler) will operate just fine under the new system (where only errors > meeting the error reporting mask get sent to the handl

Re: [PHP-DEV] error_handler

2003-12-19 Thread Lenar Lõhmus
Christian Schneider wrote: > Daniel Convissor wrote: >> Adding an optional argument has the worst of both worlds. In order to >> take advantage of it, one must lock your code into PHP 5. It doesn't work this way in PHP4 anyway. So if you really must use this feature (I think I would) you can liv

[PHP-DEV] Re: PATCH: new_link parameter to mysql_pconnect()

2003-09-14 Thread Lenar Lõhmus
And now let's attach the updated patch too. L. Lenar Lõhmus wrote: > Hi, > > Next time I'll post patches in the morning after good sleep. > Updated version attached. The original I sent is not useful. > > Lenar > >> Hi, >> >> I'v im

[PHP-DEV] Re: PATCH: new_link parameter to mysql_pconnect()

2003-09-14 Thread Lenar Lõhmus
Hi, Next time I'll post patches in the morning after good sleep. Updated version attached. The original I sent is not useful. Lenar > Hi, > > I'v implemented new_link paramater (as in mysql_connect) for > mysql_pconnect(). -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe

[PHP-DEV] PATCH: new_link parameter to mysql_pconnect()

2003-09-14 Thread Lenar Lõhmus
Hi, I'v implemented new_link paramater (as in mysql_connect) for mysql_pconnect(). Since client_flags were added to those functions in 4.3.x the parameter is 4th in mysql_connect() and 5th in mysql_pconnect(). When new_link is true when connecting to mysql database with mysql_pconnect() two thin