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
Robin
They usually never sit still long enough close by for a good photo. But this little bird was perched on this branch for several minutes letting lots of people take photos of it. When I started taking photos, it looked directly at me and my camera — it was clearly posing!
I hiked 16.2km in 3h23m19s
Updated a restaurant
Updated a restaurant
I walked 8.7km in 1h25m51s
Merged pull request #1056
Add metadata header to CSV file
RE: https://phpc.social/@Tideways/115859809842500892
Generate summary using PHP and generate summary.csv file
Created a fast_food
I walked 5.8km in 1h15m00s
I walked 1.1km in 10m08s
Merged pull request #1055
Fixed issue #2387: Remove INI entries for changed and removed Xdebug …
Merged pull request #1053
Reimplement PR #1052 with normal style
Add missing section comment
I walked 6.1km in 1h16m01s
Merge branch 'xdebug_3_5'
Merged pull request #1054
Change error retrieval method in ctrl_socket.c
Pink Sky at Sunset
I took this photo over the Christmas period in the Dutch city of Breda.
I walked 8.5km in 1h25m28s
I walked 8.1km in 1h21m10s
I walked 0.8km in 9m03s



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