1. 加入對照實驗。
2. 以++$代替$++ 以加速無用處理。
3. 平function addApple() 修改為pass by reference, 因為在oo 中也沒有複製變數

77.508211135864
77.514886856079
78.943967819214
78.752040863037
78.17006111145
78.351020812988
(78.20)

29.010772705078
28.954982757568
29.269933700562
29.193878173828
29.047966003418
29.186010360718
(29.11)

0.024795532226562
0.018835067749023
0.02288818359375
0.024080276489258
0.024795532226562
0.02288818359375
(0.023)

36.258935928345
36.988973617554
37.697076797485
37.261962890625
37.230014801025
37.543058395386
(37.16)

 -78.2 -29.11 -0.023 -37.16 1 0.37225 0.00029 0.47519

<?php
function getmicrotime() //grabbed from PHP.net documentation
{
list($usec,$sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$t1=getmicrotime(); // start stopwatch if($_GET['test']==1){
private $apples; function basket($apples) {
$this->apples=$apples;
}
++$this->apples; } }$b1=new basket(10); // start with 10 apples
for ($i=0;$i<50000; $i++) {$b1->addApple();
$b1->addApple(); } }else if($_GET['test']==2){
function addApple(&$basket) { return ++$basket;
$b1=10; // start with 10 apples for ($i=0; $i<50000;$i++) {
addApple($b1); addApple($b1);
}else if($_GET['test']==3){ }$t2=getmicrotime();
echo ($t2-$t1)*1000; //result time