Re: [PHP-DEV] Error handling brainstorming

2012-08-09 Thread Stan Vass
The overall mood seems to be that since PHP has an error handler, everyone is free to handle errors any way they want. Everyone is surprisingly ignoring the two giant holes in that theory: 1) PHP Errors come with a severity code and a string message. You want to handle specific errors in a

Re: [PHP-DEV] Error handling brainstorming

2012-08-09 Thread Stas Malyshev
Hi! Have you stopped for a moment to think this opinion through? Look at two Of course not. Why would I bother thinking? It is always safe to assume nobody thinks before writing anything to the list. typical patterns of error handling. The examples below are generalized from my file cache

Re: [PHP-DEV] Error handling brainstorming

2012-08-09 Thread Stan Vass
You are either purposefully exaggerating or not doing it right. if(fileop1() fileop2() fileop3()) { // do valid stuff } else { // do error stuff } It's not that hard. I guess it was my mistake that I simplified my actual code for simplicity's sake. Please show me how would my actual code

Re: [PHP-DEV] Error handling brainstorming

2012-08-09 Thread Ralf Lang
I know PHP's model is all messed up, but no one here, I believe, is asking about putting non-error log messages in Exceptions. IO failure is an exception. If your IO operation fails, you can't just log it and plow forward blissfully without handling the problem. Stan Exceptions allow

RE: [PHP-DEV] Re: Generators in PHP

2012-08-09 Thread Ford, Mike
-Original Message- From: Andrew Faulds [mailto:a...@ajf.me] Sent: 25 July 2012 18:03 [...] Fact: Adding a new name for a special kind of function as a syntax construct is going to cost (possibly unnecessary) time and energy, because now you have functions, and weird things that

[PHP-DEV] 5.3 status

2012-08-09 Thread Rob Richards
Whats the status of 5.3? I have some changes that need to get into a couple of the xml based extensions in order for them to work with the next libxml2 release next month. Should I be putting these into 5.3 as well? Rob -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe,

Re: [PHP-DEV] 5.3 status

2012-08-09 Thread Levi Morrison
On Thu, Aug 9, 2012 at 8:51 AM, Rob Richards rricha...@cdatazone.org wrote: Whats the status of 5.3? I have some changes that need to get into a couple of the xml based extensions in order for them to work with the next libxml2 release next month. Should I be putting these into 5.3 as well?

Re: [PHP-DEV] 5.3 status

2012-08-09 Thread Rasmus Lerdorf
On 08/09/2012 11:10 AM, Levi Morrison wrote: On Thu, Aug 9, 2012 at 8:51 AM, Rob Richards rricha...@cdatazone.org wrote: Whats the status of 5.3? I have some changes that need to get into a couple of the xml based extensions in order for them to work with the next libxml2 release next month.

Re: [PHP-DEV] 5.3 status

2012-08-09 Thread Lester Caine
Rasmus Lerdorf wrote: On 08/09/2012 11:10 AM, Levi Morrison wrote: On Thu, Aug 9, 2012 at 8:51 AM, Rob Richardsrricha...@cdatazone.org wrote: Whats the status of 5.3? I have some changes that need to get into a couple of the xml based extensions in order for them to work with the next libxml2

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Nikita Popov
On Wed, Aug 8, 2012 at 10:55 PM, Andrew Faulds a...@ajf.me wrote: Hmm. This is just a quick thought: Considering the yield syntax will vary about needing () round it, why not make it a fake function (language construct). This way it's consistent: yield(), yield($v), yield($k = $v), $a =

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Andrew Faulds
On 09/08/12 16:58, Nikita Popov wrote: On Wed, Aug 8, 2012 at 10:55 PM, Andrew Faulds a...@ajf.me wrote: Hmm. This is just a quick thought: Considering the yield syntax will vary about needing () round it, why not make it a fake function (language construct). This way it's consistent:

Re: [PHP-DEV] 5.3 status

2012-08-09 Thread Rasmus Lerdorf
On 08/09/2012 11:31 AM, Lester Caine wrote: Rasmus Lerdorf wrote: On 08/09/2012 11:10 AM, Levi Morrison wrote: On Thu, Aug 9, 2012 at 8:51 AM, Rob Richardsrricha...@cdatazone.org wrote: Whats the status of 5.3? I have some changes that need to get into a couple of the xml based extensions

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Nikita Popov
On Thu, Aug 9, 2012 at 5:59 PM, Andrew Faulds a...@ajf.me wrote: yield(), so far as the programmer is concerned, might as well be a function. It isn't, strictly speaking, but like other function calls, it suspends execution of the function until the called function completes. So I don't think

Re: [PHP-DEV] 5.3 status

2012-08-09 Thread Rob Richards
On 8/9/12 12:01 PM, Rasmus Lerdorf wrote: On 08/09/2012 11:31 AM, Lester Caine wrote: Rasmus Lerdorf wrote: On 08/09/2012 11:10 AM, Levi Morrison wrote: On Thu, Aug 9, 2012 at 8:51 AM, Rob Richardsrricha...@cdatazone.org wrote: Whats the status of 5.3? I have some changes that need to get

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread hakre
Also, currently yield looks very similar to return and I think this is a nice thing as it is similar semantically. yield($foo) would give it different semantics, imho. I love this point a lot. Return is very common and yield is some kind of return. -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
Mike Ford wrote: The signposting needn't even be as in-your-face as a generator keyword (either instead of or in addition to function): I could get behind a variation such as: function f($x, $y) yields { ... yield $z; ... } Or even (stretching a bit to re-use an existing keyword!):

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
hakre wrote: Also, currently yield looks very similar to return and I think this is a nice thing as it is similar semantically. yield($foo) would give it different semantics, imho. I love this point a lot. Return is very common and yield is some kind of return. I agree also: yield behaves