Have a read
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Edit: I think the following also still stands true (using count or sizeof):
Ok well I just gave it a quick once over...
Some of what is said in there is likely still valid, so I think Oren was just saying, fundamentally...there are still good practices in there...
Obviously some of it may become antiquated as PHP gets better, like references...I think PHP 5 automatically passes all paramters by reference doesn't it?
In that case, yes it's pointless, but there are sitll some interesting points worth mentioning or looking into...
Code: Select all
for ($j=0; $j<sizeof($arr); $j++)
echo $arr[$j]."<br>";
// This can be substantially speeded up by changing the code to:
for ($j=0, $max = sizeof($arr), $s = ''; $j<$max; $j++)
$s .= $arr[$j]."<br>";
echo $s;Some of what is said in there is likely still valid, so I think Oren was just saying, fundamentally...there are still good practices in there...
Obviously some of it may become antiquated as PHP gets better, like references...I think PHP 5 automatically passes all paramters by reference doesn't it?
In that case, yes it's pointless, but there are sitll some interesting points worth mentioning or looking into...
Really? I had no idea...I would think the opposite...but again...maybe this informaiton may also be antiquated???For processing XML, parsing with regular expressions is significantly faster than using DOM or SAX.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Only objects are passed by reference. All other types are copies.Hockey wrote:I think PHP 5 automatically passes all paramters by reference doesn't it?
Ignoring all the code in the article, some of the concepts will nearly always be true. And that's where it breaks down: they're nearly all basic concepts.
