Multiple bench on PHP Source code and result Result width : - xdebug.profiler - profiler graph by KCachegrind - result in relative time only –
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
544 B

<?php
function implodeArr()
{
$string = '';
$array = array();
for ($i = 0; $i < 100; ++$i) {
$array[] = 'MyLittlePony != 42 ';
}
$string = implode($array);
}
function classic()
{
$string = '';
for ($i = 0; $i < 100; ++$i) {
$string .= 'MyLittlePony != 42 ';
}
}
function reDefinition()
{
$string = '';
for ($i = 0; $i < 100; ++$i) {
$string == $string.'MyLittlePony != 42 ';
}
}
for ($i = 0; $i < 100000; $i++) {
implodeArr();
classic();
reDefinition();
}