[PHP-DEV] Extending support for negative string offsets

2015-07-21 Thread flaupretre
Hi, I am starting a PR (https://github.com/php/php-src/pull/1431) to add support for negative string offsets (counting from the end of the container string) where they could and, IMHO, should be supported. The already-published commits add support for negative offsets in '$string{$offset}' exp

Re: [PHP-DEV] List of possible E_RECOVERABLE_ERRORs

2015-07-21 Thread Rowan Collins
Michael Morris wrote on 21/07/2015 18:11: Hi. I hate to ask an outright question on the list rather but I've been searching the last 5 hours for an answer to this and haven't found anything and it's a rather tight corner case. I'm working on a small package for PHP 5.x that uses set_error_handle

[PHP-DEV] List of possible E_RECOVERABLE_ERRORs

2015-07-21 Thread Michael Morris
Hi. I hate to ask an outright question on the list rather but I've been searching the last 5 hours for an answer to this and haven't found anything and it's a rather tight corner case. I'm working on a small package for PHP 5.x that uses set_error_handler() to convert E_RECOVERABLE_ERRORs to the a

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Rowan Collins
Marco Pivetta wrote on 21/07/2015 13:29: Then make DateTime and DateTimeImmutable only interact with DateTime and DateTimeImmutable (or child classes), but don't rely on the interface if you're not actually respecting it internally in first place, no? What exactly are you suggesting? That DateT

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Marco Pivetta
On 21 July 2015 at 12:56, Derick Rethans wrote: > On Tue, 21 Jul 2015, Marco Pivetta wrote: > > > I should also add that this breaking change was introduced in a patch > > release (5.5.8). > > That wasn't good, but I don't see how it was a *breaking* change. It > never worked before this change e

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Derick Rethans
On Tue, 21 Jul 2015, Marco Pivetta wrote: > I should also add that this breaking change was introduced in a patch > release (5.5.8). That wasn't good, but I don't see how it was a *breaking* change. It never worked before this change either. You now just told you're doing something inappropriat

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Marco Pivetta
I should also add that this breaking change was introduced in a patch release (5.5.8). What has happened has happened, and I don't want to blame anyone, but this is actually really broken :-\ Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 21 July 2015 at 12:14, Marco P

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Marco Pivetta
Hey Niktia, On 21 July 2015 at 11:05, Niktia Nefedov wrote: > There's a workaround though - it's to always call user-defined class's > method directly from built-in functions > That's not the workaround, that's the actual fix: the current fix breaks the OO model basics by introducing a limitati

Re: [PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Niktia Nefedov
On Tue, 21 Jul 2015 15:01:06 +0400, Marco Pivetta wrote: Hello, I was looking at DateTimeInterface in order to provide my own implementation of it, when I hit this: http://3v4l.org/8GvgO > "Fatal error: DateTimeInterface can't be implemented by user classes in" Is there any actual rea

[PHP-DEV] DateTimeInterface is not a usable interface?

2015-07-21 Thread Marco Pivetta
Hello, I was looking at DateTimeInterface in order to provide my own implementation of it, when I hit this: http://3v4l.org/8GvgO > "Fatal error: DateTimeInterface can't be implemented by user classes in" Is there any actual reason for this kind of limitation? Can it be removed before going st