|
Posted by www.gerardvignes.com on 02/04/07 00:29
I tried combing PHP objects into a much smaller number of scripts,
making sure to group by usage. I couldn't measure any difference from
using on script per file. That echoes what I.Rezvin said previously.
I am already using a variety of lazy evaluation, embedding
require_once(whatever) in conditional statements. I checked this, and
it works properly on both PHP 5 and PHP 4.4. The script will not be
included unless that branch of the conditional is reached and
executed.
I started modifying my code, inserting /* & */ to stipulate object
references in a variety of places where unnecessary object copies were
made. This theoretically allows my code to work with PHP 5, and yet be
easily modified using a SED pattern to work with PHP 4. I am not
convinced that this is the best approach, given that the code becomes
a bit messy and requires an additional step prior to deployment.
I have at least identified some areas that require & references:
1. $myInstance = & new MyObject();
2. function myMethod(& $myArgument) { ... }
I am not certain which of the following is required (or both):
A. return & $myGeneratedObject;
or
B. $myNewObject = & $myInstance->myMethod($myValuet);
Thanks,
Gerard Vignes
http://www.GerardVignes.com
Seattle, WA
[Back to original message]
|