Skip to main content
3 events
when toggle format what by license comment
Jul 25, 2012 at 9:19 comment added Peter Kiss Passing by reference and dependency injection are two different things. Passing by reference is a type of argument handling in functions and methods provided by PHP, dependency injection is a design pattern what can be used in any programming language. When you say: public function __construct(ISameInterface $obj) {/* ... */} you are not passing by reference anything but you are using constructor injection.
Jul 25, 2012 at 9:12 comment added EvilChookie I think you may be getting confused by passing by reference (good!) versus returning by reference. Passing by reference is the whole point of Dependancy Injection, and is considered A Good Thing. Also, please check out codereview.stackexchange.com/questions/10060/… to see what it looked like before, and what feedback I recieved regarding it.
Jul 25, 2012 at 6:51 history answered Peter Kiss CC BY-SA 3.0