[DDC-1197] Proxies should handle variable argument lists Created: 05/Jun/11  Updated: 15/Apr/14  Resolved: 15/Apr/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Can't Fix Votes: 0
Labels: None


This is a contingency issue for https://github.com/doctrine/doctrine2/pull/60

"Fix to allow for proxy generated classes to respect methods in parent which may use func_get_args internally. Previously they would be passed nothing and thus fail. Also reduces need to build up argumentString. "

Comment by Chris Richard [ 15/Apr/14 ]

Could we use an annotation to indicate when a function uses variable arguments and output call_user_func_array only in that case?

Comment by Marco Pivetta [ 15/Apr/14 ]

I won't fix this. There are some problems here that are not trivial:

1 - to make proxies always "safe", we would need to use func_get_args in every proxy call
2 - because of (1), performance will GREATLY degrade
3 - because of (1), byref parameter passing will be broken

What we could do is introspecting the contents of methods to look for func_get_args usages (requires introduction of a complex parser).

I am closing this - consider opening an issue at https://github.com/Ocramius/ProxyManager/issues instead, so we can analyze if this logic can be improved for 3.x with the replacement of the "simple" doctrine proxies with something more complete.

Also note that https://github.com/Ocramius/ProxyManager/issues/159 could also solve this without the need for complex logic.

Generated at Tue Nov 24 17:29:14 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.