Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $string = 'hello world';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtolower($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtolower ' . $string . ' - ' . $timed . '<br>';
- $string = 'hello world';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtoupper($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtoupper ' . $string . ' - ' . $timed . '<br>';
- $string = 'HELLO WORLD';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtolower($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtolower ' . $string . ' - ' . $timed . '<br>';
- $string = 'HELLO WORLD';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtoupper($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtoupper ' . $string . ' - ' . $timed . '<br>';
- $string = 'Hello World';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtolower($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtolower ' . $string . ' - ' . $timed . '<br>';
- $string = 'Hello World';
- $start_time = microtime();
- for ($i = 0; $i < $max = 10000000; $i++) {
- strtoupper($string);
- }
- $timed = microtime() - $start_time;
- echo 'strtoupper ' . $string . ' - ' . $timed . '<br>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement