Tutorial by Examples

This is the first phase of referencing. Essentially when you assign by reference, you're allowing two variables to share the same value as such. $foo = &$bar; $foo and $bar are equal here. They do not point to one another. They point to the same place (the "value"). You can also...
Occasionally there comes time for you to implicitly return-by-reference. Returning by reference is useful when you want to use a function to find to which variable a reference should be bound. Do not use return-by-reference to increase performance. The engine will automatically optimize this o...
This allows you to pass a variable by reference to a function or element that allows you to modify the original variable. Passing-by-reference is not limited to variables only, the following can also be passed by reference: New statements, e.g. foo(new SomeClass) References returned from functi...

Page 1 of 1