Hi! > class Baz extends Bar { > function foo($a=default, $b=default) { > // do something > parent::foo($a, $b); > } > }
I tried to implement this, however there's a major issue that I do not know how to overcome. The issue is that when we compile method foo() we do not know the default values. These values are stored in RECV_INIT opcodes directly, so when we find out what the actual values are - i.e. when we resolve inheritance for class Baz - it may be in runtime, so we'd have to update opcodes for RECV_INIT in foo() in runtime. Which is not going to sit well with opcode cache, which assumes opcodes do not change. I'm not sure yet how to solve this - since the values are only stored in the opcodes it is not easy to locate them in runtime, so even if we make 'default' zvals some special type we'd still have a problem finding the right value since the binding happens in runtime and we don't have now any place to store the result of that binding. I'll think a bit more about it, in the meantime any ideas about how to resolve this problem are welcome. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php