3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cnt = 1000; $strs = [ 'empty' => '', 'short' => 'zluty kun', 'short_with_uc' => 'zluty Kun', 'long' => str_repeat('this is about 10000 chars long string', 270), 'long_with_uc' => str_repeat('this is about 10000 chars long String', 270), 'short_utf8' => 'žlutý kůň', 'short_utf8_with_uc' => 'Žlutý kŮň', ]; foreach ($strs as $k => $str) { $a1 = microtime(true); for($i=0; $i < $cnt; ++$i){ $res = strtolower($str); } $t1 = microtime(true) - $a1; // echo 'it took ' . round($t1 * 1000, 3) . ' ms for ++$i'."\n"; $a2 = microtime(true); for($i=0; $i < $cnt; $i++){ $res = mb_strtolower($str); } $t2 = microtime(true) - $a2; // echo 'it took ' . round($t2 * 1000, 3) . ' ms for $i++'."\n"; echo 'strtolower is '.round($t2/$t1, 2).'x faster than mb_strtolower for ' . $k . "\n\n"; }

Abusive script

This script was stopped while abusing our resources

Output for git.master
strtolower is 1.46x faster than mb_strtolower for empty strtolower is 2.72x faster than mb_strtolower for short strtolower is 1.84x faster than mb_strtolower for short_with_uc strtolower is 72.97x faster than mb_strtolower for long strtolower is 71.99x faster than mb_strtolower for long_with_uc strtolower is 3.43x faster than mb_strtolower for short_utf8 strtolower is 3.38x faster than mb_strtolower for short_utf8_with_uc
Output for git.master_jit
strtolower is 1.46x faster than mb_strtolower for empty strtolower is 2.6x faster than mb_strtolower for short strtolower is 1.33x faster than mb_strtolower for short_with_uc strtolower is 79.67x faster than mb_strtolower for long strtolower is 76.44x faster than mb_strtolower for long_with_uc strtolower is 3.37x faster than mb_strtolower for short_utf8 strtolower is 3.49x faster than mb_strtolower for short_utf8_with_uc
Output for rfc.property-hooks
strtolower is 1.53x faster than mb_strtolower for empty strtolower is 2.61x faster than mb_strtolower for short strtolower is 1.26x faster than mb_strtolower for short_with_uc strtolower is 92.24x faster than mb_strtolower for long strtolower is 63.12x faster than mb_strtolower for long_with_uc strtolower is 4x faster than mb_strtolower for short_utf8 strtolower is 3x faster than mb_strtolower for short_utf8_with_uc

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
94.77 ms | 409 KiB | 5 Q