12-12-2007, 04:51 PM
|
#10 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
|
Quote:
Originally Posted by Wildhoney
Fascinating finds  Although there's the distinct possibility that Jay's PC is just slower than yours, sjag. Be good to test them side-by-side on the same PC.
|
I tested them on the same computer with this code:
PHP Code:
<?php
require '../speed.php';
$string = 'Sjaakie moet poeeepeeneeeeeeeen!';
Speed::start('strlen');
for($i=0,$max=20000;$i < $max;$i++) {
if(strlen($string) > 10) {
$henk = 'skaal';
}
}
Speed::stop('strlen');
Speed::start('{strlen}');
for($i=0,$max=20000;$i < $max;$i++) {
if(!empty($string{10})) {
$henk = 'skaal';
}
}
Speed::stop('{strlen}');
Speed::compare('strlen', '{strlen}');
?>
(speed.php contains a simple speed testing class)
|
|
|
|