<pre><?php $N = 100000; $text = "Sed adipiscing molestie nunc. Nullam sodales dictum odio. Cras tellus. In l
acinia nibh ac risus. Nam eleifend blandit nulla. Sed lacinia. Maecenas ut augue
in nibh laoreet suscipit. Donec lorem. Praesent risus. Sed semper mi at eros."; function test_echo( $N, $text ) { for ( $i = 0; $i < $N; $i++ ) { } } function test_print( $N, $text ) { for ( $i = 0; $i < $N; $i++ ) { } } function test_print_with_return( $N, $text ) { for ( $i = 0; $i < $N; $i++ ) { } } foreach ( $functions as $function ) { $function( $N, $text ); $times[ $function ][ 'total' ] = ($end - $start ); $times[ $function ][ 'single' ] = ($end - $start )/ (float) $N; } foreach ( $functions as $function ) { } printf( "<br />echo jest = %f raza szybsze od print<br />", ( $times[ 'test_print' ]['total'] / $times[ 'test_echo' ]['total'] ) ); printf( "<h1>ale przy pojedynczych wywolaniach roznica jest nieistotna, bo oba czasy sa ta
k male ze byle polaczenie z baza danych zajmie znacznie wiecej czasu</h1>" ); ?></pre>
Tym postem zmiejszam roczna liczbe glupich pytan o 5 sztuk
