Welcome Guest, Not a member yet? Register   Sign In
getting a reference to code igniter super object
#4

[eluser]nourdine[/eluser]
[quote author="n0xie" date="1309792898"][quote author="C. Jiménez" date="1309791978"]because when you do &= you are referencing that object.

if you do = you get a copy.
[/quote]
No no no.

PHP5 assigns by reference by default.

Quote:When assigning an already created instance of an object to a new variable, the new variable will access the same instance as the object that was assigned. This behaviour is the same when passing instances to a function. A new instance of an already created object can be made by cloning it.

The reason the examples use =& is because it's backwards compatible with PHP4. In PHP4 assigning an object would clone the object.[/quote]

Wink so am damn right aint i?


Messages In This Thread
getting a reference to code igniter super object - by El Forum - 07-04-2011, 02:47 AM
getting a reference to code igniter super object - by El Forum - 07-04-2011, 04:06 AM
getting a reference to code igniter super object - by El Forum - 07-04-2011, 04:21 AM
getting a reference to code igniter super object - by El Forum - 07-04-2011, 06:10 AM
getting a reference to code igniter super object - by El Forum - 07-04-2011, 06:25 AM
getting a reference to code igniter super object - by El Forum - 07-06-2011, 01:52 AM
getting a reference to code igniter super object - by El Forum - 07-06-2011, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB