News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sara Golemon's:
You're being lied to.
January 29, 2007 @ 08:38:00

If you think you know what's going on behind the scenes when you're working with objects in PHP5 - you're wrong. You're even being lied to, according to Sara Golemon's latest entry:

If you're among the crowd who have migrated an OOP based application from PHP4 to PHP5, then I'm sure you've heard the expression "Objects are copied by reference by default in PHP5". Whoever told you that, was lying.

As she explains, the truth is more that they behave that way, not that they are actually like that. She talks about what objects actually are and how things are handled differently from PHP4 to PHP5. She also "lies" a little also about the "copying" part, and explains the internal structure of a variable to show why.

She also includes a bit on why referencing variables when it's not really a must is a bad idea - the main idea of it being a waste of space and memory in the application.

0 comments voice your opinion now!
php5 object reference copy behave lie php5 object reference copy behave lie


blog comments powered by Disqus

Similar Posts

DevShed: Parsing Web Document Nodes with the Tidy Library in PHP 5

Pavel Shevaev's Blog: A reliable way to serialize/unserialize objects in PHP

Matthew Weir O'Phinney's Blog: Overloading arrays in PHP 5.2.0

DevShed: Expanding the Application Range of Visitor Objects in PHP 5

DevShed: Enforcing Object Types in PHP - Using the PHP5 instanceof Operator


Community Events





Don't see your event here?
Let us know!


series community update framework library symfony tool version language package podcast security introduction interview release voicesoftheelephpant opinion mvc laravel composer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework