| // +----------------------------------------------------------------------+ // | Requires PHP version 4.0.3 and up | // +----------------------------------------------------------------------+ /*** * Sample * $profileTest[] = array ( * 'title' => 'For-loop test', * 'text' => 'Is it worth the effort to calculate the length of the loop in advance?', * 'function' => 'forLoop', // Funcion basename * 'param' => '' // This wil be passed to your function. * ); */ # For foreach vs while(list()=each()) $profileTest[] = array ( 'title' => 'READ LOOP: foreach()    vs.    while(list()=each())', 'text' => 'What is the best way to loop a hash array?
Given is a Hash array ' . 'with 100 elements, 24byte key and 10k data per entry
' . 'I\'ve chosen the large data amount to try out what happens if I reference the ' . 'data with the &-ref-operator (to avoid copying). But to my surprise ' . 'the loops are never faster! In tests 5 and 6 are even 10x - 30x slower !! ' . 'The larger the data entrys are the slower the tests 5 and 6 get! ' . 'Copying seams always faster then using the &-ref-operator.' . '
Way ???
Let me know at bs_php@users.sourceforge.net
', 'function' => 'forEach', 'param' => 10, // Loop x times through the hash described above 'conclusion'=> 'It must have something to do with PHP4 variable ref-count ' . 'So you can safely use foreach and only use the &-ref-operator when realy needed OR (according to the link above) ' . 'when passing objects to functions. (Thanx to Wayne for his help)' ); # For foreach vs while(list()=each()) $profileTest[] = array ( 'title' => 'MODIFY LOOP: foreach()    vs.    while(list()=each())', 'text' => 'While the above test only reads and copies the data the question arised what ' . 'would happen if I modify each value of the hash above.
' . 'Again I an unexpected result. Even if I reduce the data size to 100 byte p. e. ' . 'it ends up that Nr.3 is 1.5 - 2x faster.', 'function' => 'forEachMod', 'param' => 10, // Loop x times through the hash described above 'conclusion'=> 'Use foreach unless the hash is lage AND has lage data elements. In that case use variation Nr.3 .' ); # For loop tests $profileTest[] = array ( 'title' => 'For-loop test', 'text' => 'Is it worth the effort to calculate the length of the loop in advance? ' .'
E.g. "for ($i=0; $i<$size; $i++)" instead of "for ($i=0; $i<sizeOf($x); $i++)"', 'function' => 'forLoop', 'param' => '', // This wil be passed to your function. 'conclusion'=> 'The test above speeks for it self. Always calculate the length of the loop in advance!' ); # Using the &-ref-operator as so called "alias" $profileTest[] = array ( 'title' => 'Using the &-ref-operator as so called "alias"' , 'text' => 'Is a good idea to use the &-ref-operator to substitute (or alias) a complex mutidim-array? . Call 1\'000x' .'
E.g. $person = &$aHach["country"]["zip"]["streat"]["number"]["name"]', 'function' => 'aliasing', 'param' => '1000', // This wil be passed to your function. 'conclusion'=> 'It seams to be ok to use aliases. It also makes the code more readabel. But I was expecting to get a lager ' .'performance gain; especially with very multdimetional arrays.' ); # $obj = new SomeClass() vs. $obj =& new SomeClass() using the =&-ref-operator $profileTest[] = array ( 'title' => '$obj = new SomeClass()    vs.    $obj =& new SomeClass() using the =&-ref-operator', 'text' => 'Is a good idea to use the =&-ref-operator when creating a new object? Call 1\'000x', 'function' => 'newClass', 'param' => '1000', // This wil be passed to your function. 'conclusion'=> 'There seams to be no difference in performance.' ); # The difference in using double (") and single (') quotes $profileTest[] = array ( 'title' => 'double (")    vs.    single (\') quotes', 'text' => 'Is a there a difference in using double (") and single (\') quotes for strings. Call 1\'000x', 'function' => 'doubleOrSingleQuote', 'param' => '1000', // This wil be passed to your function. 'conclusion'=> 'Single and double quoted strings behave almost the same with one exception: Don\'t use the a lonely ($) in double quoted string ' .'unless you want to reference a PHP-var; or use (\$). ' ); # isSet test $profileTest[] = array ( 'title' => 'isSet()    vs.    empty()    vs.    is_array()', 'text' => 'What is the performance of isSet() and empty(). Call 2\'000x', 'function' => 'isSetVsEmpty', 'param' => '2000', // This wil be passed to your function. 'conclusion'=> 'isSet() and empty() are identical. Interesting that a is_array() on a unset val is 3x slower. So alway check if val is set at ' .'all befor using type-checking. E.g. if (isSet($foo) AND is_array($foo))' ); # case or if elseif $profileTest[] = array ( 'title' => 'switch/case    vs.    if/elseif', 'text' => 'Is a there a difference between switch and if elseif. Call 1\'000x', 'function' => 'ifOrCase', 'param' => '1000', // This wil be passed to your function. 'conclusion'=> 'Using a switch/case or if/elseif is almost the same. Note that the test is unsing === and is slitly faster then using ==.' ); // ------------------------------------------------------------------ // ------------------------------------------------------------------ // Add your functions below here #---------------------------------------------------------------------- # For foreach vs while(list()=each()) //Prepare a dummy test hash $aHash = array(); class someClass { var $var1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; var $var2 = 100; function someClass() {} function f3($a='bar',$b) {} function f4($a=1,$b=2) {} function f5($a,$b) { static $tmp = array('a'=>'b');} function &retObj1() { $c =& new someClass(); return $c; } function retObj2() { $c =& new someClass(); return $c; } function &retObj3() { return new someClass(); } function retObj4() { return new someClass(); } } $bigData .= str_repeat('a', 10000); for ($i=0; $i<100; $i++) { $key=''; for ($j=0; $j<24; $j++) { $key .= chr(mt_rand(32,88)); } $bigData .= chr(mt_rand(33,88)); $aHash[$key] = $bigData; } /* for ($i=0; $i<100; $i++) { $key=''; for ($j=0; $j<24; $j++) { $key .= chr(mt_rand(32,88)); } $aHash[$key] = new someClass(); } */ function forEach1($param, &$profTest) { $profTest['TestCaption'][] = 'foreach($aHash as $val);'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { foreach($aHash as $val); } } function forEach2($param, &$profTest) { $profTest['TestCaption'][] = 'while(list(,$val) = each($aHash));'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { reset($aHash); while(list($key) = each($aHash)) $aHash[$key] .= "a" ; } } // --- function forEach3($param, &$profTest) { $profTest['TestCaption'][] = 'foreach($aHash as $key=>$val);'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { foreach($aHash as $key=>$val) $aHash[$key] .= "a"; } } function forEach4($param, &$profTest) { $profTest['TestCaption'][] = 'while(list($key,$val)= each($aHash));'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { reset($aHash); while(list($key,$val) = each($aHash)) $aHash[$key] .= "a"; } } // --- function forEach5($param, &$profTest) { $profTest['TestCaption'][] = 'foreach($aHash as $key=>$val) $tmp[] = &$aHash[$key];'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { foreach($aHash as $key=>$val) $tmp[] = &$aHash[$key]; } } function forEach6($param, &$profTest) { $profTest['TestCaption'][] = 'while(list($key) = each($aHash)) $tmp[]=&$aHash[$key];'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { reset($aHash); while(list($key) = each($aHash)) $tmp[]=&$aHash[$key]; } } // --- function forEach7($param, &$profTest) { $profTest['TestCaption'][] = 'Get key-/ value-array: foreach($aHash as $key[]=>$val[]);'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { foreach($aHash as $key[]=>$val[]); } } function forEach8($param, &$profTest) { $profTest['TestCaption'][] = 'Get key-/ value-array: array_keys() / array_values()'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { $key = array_keys($aHash); $val = array_values($aHash); } } function forEach9($param, &$profTest) { $profTest['TestCaption'][] = 'STRANGE: This is the fasetest code when using the the &-ref-operator (to avoid copying)
$key = array_keys($aHash);
$size = sizeOf($key);
for ($i=0; $i<$size; $i++) $tmp[] = &$aHash[$key[$i]];'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { $key = array_keys($aHash); $size = sizeOf($key); for ($j=0; $j<$size; $j++) $aHash[$key[$i]] .= "a"; } } #---------------------------------------------------------------------- # For foreach vs while(list()=each()) //Prepare a dummy test hash function forEachMod1($param, &$profTest) { $profTest['TestCaption'][] = 'foreach($aHash as $key=>$val) $aHash[$key] .= "a";'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { foreach($aHash as $key=>$val) $aHash[$key] .= "a"; } } // --- function forEachMod2($param, &$profTest) { $profTest['TestCaption'][] = 'while(list($key) = each($aHash)) $aHash[$key] .= "a";'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { reset($aHash); while(list($key) = each($aHash)) $aHash[$key] .= "a" ; } } // --- function forEachMod3($param, &$profTest) { $profTest['TestCaption'][] = 'STRANGE: This is the fasetest code :
$key = array_keys($aHash);
$size = sizeOf($key);
for ($i=0; $i<$size; $i++) $aHash[$key[$i]] .= "a";'; global $aHash; // Do it 5x instead a 5x lager hash (memory problems) for ($i=0; $i<$param; $i++) { $key = array_keys($aHash); $size = sizeOf($key); for ($j=0; $j<$size; $j++) $aHash[$key[$i]] .= "a"; } } #---------------------------------------------------------------------- # For loop tests // some inits: $forLoop = str_repeat('a', 10000); function forLoop1($param, &$profTest) { $profTest['TestCaption'][] = 'With pre calc'; global $forLoop; $leng = strLen($forLoop); for ($i=0; $i<$leng; $i++) ; } function forLoop2($param, &$profTest) { $profTest['TestCaption'][] = 'Without pre calc'; global $forLoop; for ($i=0; $i"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for ($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = $aMultiDimArray[$idx]["Name"]; $tmp[$idx] = $aMultiDimArray[$idx]["streat"]; $tmp[$idx] = $aMultiDimArray[$idx]["zip"]; } } function aliasing2($param, &$profTest) { $profTest['TestCaption'][] = 'Aliasing. Using: $alias = &$aSingleDimArray[$i]'; $aMultiDimArray[0] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for ($i=0; $i<$param; $i++) { $idx = $i%2; $alias = &$aMultiDimArray[$idx]; $tmp[$idx] = $alias["Name"]; $tmp[$idx] = $alias["streat"]; $tmp[$idx] = $alias["zip"]; } } function aliasing3($param, &$profTest) { $profTest['TestCaption'][] = 'NO Aliasing. Using: $aMultiDimArray[$i]["aaaaa"]["aaaaaaaaaa"]'; $aMultiDimArray[0]["aaaaa"]["aaaaaaaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1]["aaaaa"]["aaaaaaaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = $aMultiDimArray[$idx]["aaaaa"]["aaaaaaaaaa"]["Name"]; $tmp[$idx] = $aMultiDimArray[$idx]["aaaaa"]["aaaaaaaaaa"]["streat"]; $tmp[$idx] = $aMultiDimArray[$idx]["aaaaa"]["aaaaaaaaaa"]["zip"]; } } function aliasing4($param, &$profTest) { $profTest['TestCaption'][] = 'Aliasing. Using: $alias = &$aMultiDimArray[$i]["aaaaa"]["aaaaaaaaaa"]'; $aMultiDimArray[0]["aaaaa"]["aaaaaaaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1]["aaaaa"]["aaaaaaaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for ($i=0; $i<$param; $i++) { $idx = $i%2; $alias = &$aMultiDimArray[$idx]["aaaaa"]["aaaaaaaaaa"]; $tmp[$idx] = $alias["Name"]; $tmp[$idx] = $alias["streat"]; $tmp[$idx] = $alias["zip"]; } } function aliasing5($param, &$profTest) { $profTest['TestCaption'][] = 'NO Aliasing. Using: veryMultiDimArray[$i]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]'; $aMultiDimArray[0]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for ($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = $aMultiDimArray[$idx]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]["Name"]; $tmp[$idx] = $aMultiDimArray[$idx]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]["streat"]; $tmp[$idx] = $aMultiDimArray[$idx]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]["zip"]; } } function aliasing6($param, &$profTest) { $profTest['TestCaption'][] = 'Aliasing. Using: $alias = &$veryMultiDimArray[$i]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]'; $aMultiDimArray[0]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); $aMultiDimArray[1]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"] = array("Name"=>"Peter Pan", "streat"=>"Wonderlandstr 24", "zip"=>1234); for ($i=0; $i<$param; $i++) { $idx = $i%2; $alias = &$aMultiDimArray[$idx]["a"]["aa"]["aaa"]["aaaa"]["aaaaa"]; $tmp[$idx] = $alias["Name"]; $tmp[$idx] = $alias["streat"]; $tmp[$idx] = $alias["zip"]; } } #---------------------------------------------------------------------- # $obj = new SomeClass() vs. $obj =& new SomeClass() using the =&-ref-operator function newClass1($param, &$profTest) { $profTest['TestCaption'][] = '$obj = new SomeClass()'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = new SomeClass(); } } function newClass2($param, &$profTest) { $profTest['TestCaption'][] = '$obj =& new SomeClass()'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] =& new SomeClass(); } } function newClass3($param, &$profTest) { $profTest['TestCaption'][] = '$obj =& $someClass->f();'; $obj = new SomeClass(); for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] =& $obj->retObj3(); } } function newClass4($param, &$profTest) { $profTest['TestCaption'][] = '$obj = $someClass->f();'; $obj = new SomeClass(); for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = $obj->retObj4(); } } #---------------------------------------------------------------------- # double (") vs. single (') quotes function doubleOrSingleQuote1($param, &$profTest) { $profTest['TestCaption'][] = "single (') quotes. Just an empty string: \$tmp[] = '';"; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = ''; } } function doubleOrSingleQuote2($param, &$profTest) { $profTest['TestCaption'][] = 'double (") quotes. Just an empty string: $tmp[] = "";'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = ""; } } function doubleOrSingleQuote3($param, &$profTest) { $profTest['TestCaption'][] = "single (') quotes. 20 bytes Text : \$tmp[] = 'aaaaaaaaaaaaaaaaaaaa';"; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = 'aaaaaaaaaaaaaaaaaaaa'; } } function doubleOrSingleQuote4($param, &$profTest) { $profTest['TestCaption'][] = 'double (") quotes. 20 bytes Text : $tmp[] = "aaaaaaaaaaaaaaaaaaaa";'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = "aaaaaaaaaaaaaaaaaaaa"; } } function doubleOrSingleQuote5($param, &$profTest) { $profTest['TestCaption'][] = "single (') quotes. 20 bytes Text and 3x a $ : \$tmp[] = 'aa $ aaaa $ aaaa $ a';"; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = 'aa $ aaaa $ aaaa $ a'; } } function doubleOrSingleQuote6($param, &$profTest) { $profTest['TestCaption'][] = 'double (") quotes. 20 bytes Text and 3x a $ : $tmp[] = "aa $ aaaa $ aaaa $ a";'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = "aa $ aaaa $ aaaa $ a"; } } function doubleOrSingleQuote7($param, &$profTest) { $profTest['TestCaption'][] = 'double (") quotes. 20 bytes Text and 3x a \$ : $tmp[] = "aa \$ aaaa \$ aaaa \$ a";'; for($i=0; $i<$param; $i++) { $idx = $i%2; $tmp[$idx] = "aa \$ aaaa \$ aaaa \$ a"; } } #---------------------------------------------------------------------- # isSet() vs. empty() function isSetVsEmpty1($param, &$profTest) { $profTest['TestCaption'][] = 'isSet() with var that was set'; $var = 1; for ($i=0; $i<$param; $i++) isSet($var); } function isSetVsEmpty2($param, &$profTest) { $profTest['TestCaption'][] = 'empty() with var that was set'; $var = 1; for ($i=0; $i<$param; $i++) empty($var); } function isSetVsEmpty3($param, &$profTest) { $profTest['TestCaption'][] = 'isSet() with var that was *not* set'; for ($i=0; $i<$param; $i++) isSet($sdjf); } function isSetVsEmpty4($param, &$profTest) { $profTest['TestCaption'][] = 'empty() with var that was *not* set'; for ($i=0; $i<$param; $i++) empty($sdjf); } function isSetVsEmpty5($param, &$profTest) { $profTest['TestCaption'][] = 'isSet() with array-var that was set'; $var = array('22'=>TRUE); for ($i=0; $i<$param; $i++) isSet($var[22]); } function isSetVsEmpty6($param, &$profTest) { $profTest['TestCaption'][] = 'empty() with array-var that was set'; $var = array('22'=>TRUE); for ($i=0; $i<$param; $i++) empty($var[22]); } function isSetVsEmpty7($param, &$profTest) { $profTest['TestCaption'][] = 'isSet() with array-var that was *not* set'; $var = array('22'=>TRUE); for ($i=0; $i<$param; $i++) isSet($var[23]); } function isSetVsEmpty8($param, &$profTest) { $profTest['TestCaption'][] = 'empty() with array-var that was *not* set'; $var = array('22'=>TRUE); for ($i=0; $i<$param; $i++) empty($var[23]); } function isSetVsEmpty9($param, &$profTest) { $profTest['TestCaption'][] = 'is_array() of an array'; $var = array(); for ($i=0; $i<$param; $i++) is_array($var); } function isSetVsEmpty10($param, &$profTest) { $profTest['TestCaption'][] = 'is_array() of a string'; $var = ''; for ($i=0; $i<$param; $i++) is_array($var); } function isSetVsEmpty11($param, &$profTest) { $profTest['TestCaption'][] = 'is_array() of a non set value'; for ($i=0; $i<$param; $i++) is_array($gaga); } function isSetVsEmpty12($param, &$profTest) { $profTest['TestCaption'][] = 'isSet() AND is_array() of a non set value'; for ($i=0; $i<$param; $i++) (isSet($gaga) AND is_array($gaga)); } #---------------------------------------------------------------------- # switch/case vs. if/elseif function ifOrCase1($param, &$profTest) { $profTest['TestCaption'][] = 'if and elseif (using ==)'; for($i=0; $i<$param; $i++) { $res = $i % 10; if ($res == 0) { } elseif ($res == 1) { } elseif ($res == 2) { } elseif ($res == 3) { } elseif ($res == 4) { } elseif ($res == 5) { } elseif ($res == 6) { } elseif ($res == 7) { } elseif ($res == 8) { } else { } } } function ifOrCase2($param, &$profTest) { $profTest['TestCaption'][] = 'if and elseif (using ===)'; for($i=0; $i<$param; $i++) { $res = $i % 10; if ($res === 0) { } elseif ($res === 1) { } elseif ($res === 2) { } elseif ($res === 3) { } elseif ($res === 4) { } elseif ($res === 5) { } elseif ($res === 6) { } elseif ($res === 7) { } elseif ($res === 8) { } else { } } } function ifOrCase3($param, &$profTest) { $profTest['TestCaption'][] = 'case'; for($i=0; $i<$param; $i++) { $res = $i % 10; switch($res) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; case 6: break; case 7: break; case 8: break; default: break; } } } #======================================================================= # Don't add anything below this line #======================================================================= $out = ''; $out .= '

PHP Benchmark tests

'; $out .= ''; $out .= ''; $out .= '
NOTE You must keep in mind to refresh this page a few times ' . 'to "catch" the right result. The numbers change sometimes drastically during ' . 'each refresh. I assume that this is because of PHP\'s memory garbage collector ' . 'that drops in randomly and also other processes that run on this machine have an ' . 'influence.
'; $testSize = sizeOf($profileTest); for ($i=0; $i<$testSize; $i++) { $profTest = &$profileTest[$i]; if ($profTest['title'] == $runOnlyThis) continue; // Now loop through the functions of every test $funcionNr = 1; $function = $profTest['function'] . $funcionNr; while(function_exists($function)) { $sTime = explode(' ', microtime()); $function($profTest['param'], $profTest); $eTime = explode(' ', microtime()); $profTest['result'][] = (($eTime[1] - $sTime[1]) + ($eTime[0] - $sTime[0]))*1000; $funcionNr++; $function = $profTest['function'] . $funcionNr; } $out .= '
' . '
' . '' . '' ; $fastets = $profTest['result'][0]; for ($res=1; $res300) $bgc = '#ff8080'; elseif ($procent>200) $bgc = '#fccb96'; elseif ($procent>150) $bgc = '#f9ff79'; else $bgc = '#79ff79'; $out .= ""; $out .= "'; $out .= "'; } $out .= ''; $out .= "'; $out .= '
' . 'Test:
' . $profTest['title'] . '
' . $profTest['text'] . '
"; $out .= '+'.str_replace(' ',' ',str_pad($procent,5,' ',STR_PAD_LEFT)).' %'; $out .= '"; $funcName = $profTest['function'][$res]; $out .= isSet($profTest['TestCaption'][$res]) ? ($res+1).': '. $profTest['TestCaption'][$res] : ' '; $out .= ''; $time = round($profTest['result'][$res]); $time = str_pad($time,5,' ',STR_PAD_LEFT); $out .= 'Total time:' . str_replace(' ',' ',$time) . '[ms]'; $out .= '
"; $out .= 'Conclusion:
' . $profTest['conclusion']; $out .= '

'; } echo ''; echo $out; echo ''; ?>