On Sat, 07 Aug 2010 03:55:25 +0100, Etienne Kneuss
wrote:
Returning a ref is an additional constraint, meaning that it would
actually be covariance, and not contravariance. But yes, it makes
sense.
Yes, you are right. To put it another way: a subclass should be able to
* Relax the precon
Hi!
For now you can only index an array using a scalar type or a string.
Is there some rfc or work going on to enlarge the possibility so that it
is possible to have some other object like:
I think SplObjectStorage implements most common use-case for such
behavior, do you have any other one t
Hi!
In my opinion, it would make more sense, as was already suggested before,
to require the return to be passed by reference only if the prototype
specifies it should be passed by reference. This could be argued to be a
form of return contravariance.
Yes, this makes sense.
--
Stanislav Malys
On Fri, 06 Aug 2010 15:50:33 +0100, Ralph Schindler
wrote:
The attached patch is the suggested fix. I made this against master on
github.
In my opinion, it would make more sense, as was already suggested before,
to require the return to be passed by reference only if the prototype
spe
On Fri, Aug 6, 2010 at 16:33, mathieu.suen wrote:
> Hi,
>
> For now you can only index an array using a scalar type or a string.
> Is there some rfc or work going on to enlarge the possibility so that it is
> possible to have some other object like:
>
I don't think it makes sense.
You can howeve
The attached patch is the suggested fix. I made this against master on
github.
-ralph
Ralph Schindler wrote:
I can give 2 examples, one that triggers the problem, the other that is
a real world issue:
---
Simple:
PHP Fatal error: Declaration of C::foo() must be compatible with that
of I
On 6 August 2010 15:33, mathieu.suen wrote:
> Hi,
>
> For now you can only index an array using a scalar type or a string.
> Is there some rfc or work going on to enlarge the possibility so that it is
> possible to have some other object like:
>
> - closure
> - object
> - etc.
>
> Thanks
>
> -- Ma
On Fri, 06 Aug 2010 15:33:18 +0100, mathieu.suen
wrote:
Hi,
For now you can only index an array using a scalar type or a string.
Is there some rfc or work going on to enlarge the possibility so that it
is possible to have some other object like:
- closure
- object
- etc.
I think the probl
Hi,
For now you can only index an array using a scalar type or a string.
Is there some rfc or work going on to enlarge the possibility so that it
is possible to have some other object like:
- closure
- object
- etc.
Thanks
-- Mathieu Suen
I can give 2 examples, one that triggers the problem, the other that is
a real world issue:
---
Simple:
PHP Fatal error: Declaration of C::foo() must be compatible with that
of I::foo() in path/to/test-reference-in-signature.php on line 8
Real world issue with ArrayAccess:
array(1
On Tue, 27 Apr 2010, Etienne Kneuss wrote:
> Hi,
>
> it looks like the fact that ArrayAccess::offsetGet is not returning a
> reference is a recurrent problem, I see basically 4 options:
>
> a) Ignore the issue, change nothing
>
> b) Rewrite offsetGet to return a ref, breaking BC
>
> c) Create
Hi,
well, my apologies for not making that clear enough. I suppose it
wouldn't require any runtime information, as this kind of construct
could be expanded at compile time.
For example:
willUse('LibraryWithAVeryLongName\Cache\FileCache')
->willUse('LibraryWithAVeryLongName\Routing\Cach
12 matches
Mail list logo