<?php
class SomeObj {
public funcion doTest() {;}
}
$someObj = new SomeObj;
class SomeClass {
public static funcion doTest() {;}
}
function something_doTest() {}
// bench static method
$starttime = microtime(true);
for ($i = 0; $i< 10*1000*1000; $i++)
SomeClass::doTest($i);
echo "Static Time: " , (microtime(true)-$starttime) , " ms\n";
// bench object method
$starttime = microtime(true);
for ($i = 0; $i< 10*1000*1000; $i++)
$someObj->doTest($i);
echo "Object Time: " , (microtime(true)-$starttime) , " ms\n";
// bench function
$starttime = microtime(true);
for ($i = 0; $i< 10*1000*1000; $i++)
something_doTest($i);
echo "Function Time: " , (microtime(true)-$starttime) , " ms\n";
- Output for 5.4.0 - 5.4.26
- Parse error: syntax error, unexpected 'funcion' (T_STRING), expecting variable (T_VARIABLE) in /in/lKL27 on line 5
Process exited with code 255. - Output for 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/lKL27 on line 5
Process exited with code 255.
preferences:
218.48 ms | 1395 KiB | 63 Q