Variables and References Article
A week ago PHP 4.4.0rc1 was released - this release addresses major problems with references in PHP. But not many people are fully aware of how variables and references actually work in PHP. This is where my latest article in PHP Architect comes into play. It explains in details how assigning variables, passing variables to functions and returning variables from functions work - both by-value and by-reference.
Comments
Thanx for the article, it gives a deep insight into PHP internals.
However, there's one issue left unspoken, that is PHP5 objects internal model. It's obvious they're not just variables...
How are they implemented actually?
Consider the following lines in PHP5:
$a = new Foo(); $b = $a;
Is it equivalent internally in PHP5 to this:
$a = new Foo(); $b =& $a;
If not what the difference? Is it actually "healthy" to use & with objects in PHP5? Is there speed overhead?
I'm asking all these questions because we're using PHP5 with applications which were written solely for PHP4 yet using OOP. These applications use & almost everywhere and i wonder how PHP5 treats it internally....
Life Line
A Colourful Mandarin
In The Long Water in Kensington Palace Gardens, London.
Created 7 benches
Created 2 benches
Created a bench
I walked 7.3km in 2h28m39s
Added a note about a duplicate Papersmiths
I walked 4.1km in 49m02s
Fixed website
fix typo
Updated a bench
I walked 1.6km in 20m26s
I walked 1.1km in 11m49s
The Yellow Eye
A blue heron's head, with its very yellow stare-y eye.
#BirdPhotography #Photography #BirdsOfFediverse #BirdsOfMastodon #London
My little Lego box is telling me it really is quite warm outside.
Created a bicycle_parking and a crossing
I walked 3.3km in 41m56s
What the United States and Israel are doing to Iran is undistinguishable from Russia is doing to Ukraine.
Created 8 waste_baskets, 7 benches, and 5 other objects
I walked 2.7km in 42m28s
The Early Bird Catches the Worm
Updated a pub
Created 3 recyclings, 3 waste_baskets, and 2 other objects
I walked 3.4km in 56m37s






Shortlink
This article has a short URL available: https://drck.me/vara-41v