Re: Fwd: Re: [PHP-PEAR] PEAR::isError()

From: Date: Tue, 05 Dec 2000 11:12:35 +0000
Subject: Re: Fwd: Re: [PHP-PEAR] PEAR::isError()
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-40105@lists.php.net to get a copy of this message
At 12:36 5/12/2000, Ulf Wendel wrote:
Zeev Suraski schrieb: At 11:08 5/12/2000, Ulf Wendel wrote:
I must confess that I did not meter the lastest 4.0.4dev version but a version before (4.0.1dev or so) and I can't say that reference are faster. The opposite is true in my eyes. In PHPDoc there are many, many situations where I thought of passing by reference or using references. But I did not - not only to be PHP 3 compatible. Pass by value seems to be faster. At least with huge arrays as they get used in PHPDoc (tree structures need references...).
As a separate letter (after totally agreeing you shouldn't pass by reference for performance reasons) - that's not what Andi said. Andi Sorry, Andi. talked only about passing *objects*. In case of any other data type (arrays included), passing by value is faster. This is not what you expect, how comes? This is really strange. Does this result mean that you're working on the reference issue and we can expect dramatic speed improvements in future versions?
It has to do with how objects are implemented, and the way the reference counting mechanism works. Simply put - (1) objects will always be references, and other data types will usually not be references (2) Passing references by reference is quicker than not, passing non-reference by reference is slower than not Again, I do not encourage people to modify their code in order to take advantage of this fact. Zeev -- Zeev Suraski <zeev@zend.com> CTO, Zend Technologies Ltd. http://www.zend.com/

« previous php.dev (#40105) next »