See https://bugs.php.net/bug.php?id=66331
With PHPUnit real use cse (trying to mock memcached class)
We have more options in Extension land that in user land.
Of course if will be great to be able to correctly handle those arginfo
mapping in userland, but we have, for now, no way to say "PREFER_REF" in
PHP land.
So my proposal is to make proto check a little less stric and consider
ZEND_SEND_PREFER_REF as ZEND_SEND_REF, so this will allow to override a
internal class method (using "prefer") in a php class.
Any better idea ?
Or could I apply this fix ?
Remi.
See https://bugs.php.net/bug.php?id=66331
With PHPUnit real use cse (trying to mock memcached class)We have more options in Extension land that in user land.
Of course if will be great to be able to correctly handle those arginfo
mapping in userland, but we have, for now, no way to say "PREFER_REF" in
PHP land.So my proposal is to make proto check a little less stric and consider
ZEND_SEND_PREFER_REF as ZEND_SEND_REF, so this will allow to override a
internal class method (using "prefer") in a php class.Any better idea ?
Or could I apply this fix ?
Changing a prefer-ref argument into a by-ref argument via inheritance
violates LSP, so the code is right to refuse it. What I'd do instead is to
automatically convert userland by-ref arguments extending prefer-ref
arguments to also be prefer-ref. The resulting behavior might be a tad
unexpected, but I think that's better than allowing LSP violations here.
Nikita