3v4l.org

run code in 200+ PHP versions simultaneously
<?php $str = str_repeat('a', 1e4); $start = microtime(true); $pos = 0; while(preg_match('/\G\w/', $str, $m, 0, $pos)) ++$pos; $end = microtime(true); echo 'NO u flag: ', number_format(($end - $start)*1000, 6), 'ms', PHP_EOL; $str = str_repeat('e', 1e4); $start = microtime(true); $pos = 0; while(preg_match('/\G\w/u', $str, $m, 0, $pos)) ++$pos; $end = microtime(true); echo 'WITH u flag: ', number_format(($end - $start)*1000, 6), 'ms', PHP_EOL;
based on Sr2tT
Output for 7.2.0
NO u flag: 1.468897ms WITH u flag: 65.593958ms
Output for 7.1.7
NO u flag: 4.184961ms WITH u flag: 84.441185ms
Output for 7.1.6
NO u flag: 4.276991ms WITH u flag: 111.253023ms
Output for 7.1.5
NO u flag: 4.903078ms WITH u flag: 103.859901ms
Output for 7.1.0
NO u flag: 3.307104ms WITH u flag: 94.552994ms
Output for 7.0.20
NO u flag: 11.445999ms WITH u flag: 93.754053ms
Output for 7.0.10
NO u flag: 3.031015ms WITH u flag: 68.365812ms
Output for 7.0.9
NO u flag: 4.181147ms WITH u flag: 76.426029ms
Output for 7.0.8
NO u flag: 4.132986ms WITH u flag: 80.375195ms
Output for 7.0.7
NO u flag: 2.727985ms WITH u flag: 60.050964ms
Output for 7.0.6
NO u flag: 3.330946ms WITH u flag: 64.895153ms
Output for 7.0.5
NO u flag: 3.072023ms WITH u flag: 66.771030ms
Output for 7.0.4
NO u flag: 2.507925ms WITH u flag: 55.790901ms
Output for 7.0.3
NO u flag: 3.854036ms WITH u flag: 75.255156ms
Output for 7.0.2
NO u flag: 3.813028ms WITH u flag: 66.403866ms
Output for 7.0.1
NO u flag: 3.804207ms WITH u flag: 75.227976ms
Output for 7.0.0
NO u flag: 3.029108ms WITH u flag: 62.868834ms
Output for 5.6.25
NO u flag: 6.417990ms WITH u flag: 65.184116ms
Output for 5.6.24
NO u flag: 6.597042ms WITH u flag: 61.654091ms
Output for 5.6.23
NO u flag: 5.596161ms WITH u flag: 67.868948ms
Output for 5.6.22
NO u flag: 6.498098ms WITH u flag: 62.876940ms
Output for 5.6.21
NO u flag: 7.489920ms WITH u flag: 74.849129ms
Output for 5.6.20
NO u flag: 7.184982ms WITH u flag: 74.710131ms
Output for 5.6.19
NO u flag: 5.612135ms WITH u flag: 64.266920ms
Output for 5.6.18
NO u flag: 5.526066ms WITH u flag: 59.587002ms
Output for 5.6.17
NO u flag: 5.864859ms WITH u flag: 71.650028ms
Output for 5.6.16
NO u flag: 6.699085ms WITH u flag: 77.172041ms
Output for 5.6.15
NO u flag: 5.311012ms WITH u flag: 60.501099ms
Output for 5.6.14
NO u flag: 6.145954ms WITH u flag: 67.800999ms
Output for 5.6.13
NO u flag: 6.368876ms WITH u flag: 69.634914ms
Output for 5.6.12
NO u flag: 4.630089ms WITH u flag: 63.292027ms
Output for 5.6.11
NO u flag: 7.199049ms WITH u flag: 66.701889ms
Output for 5.6.10
NO u flag: 4.907846ms WITH u flag: 58.591127ms
Output for 5.6.9
NO u flag: 5.843163ms WITH u flag: 71.094036ms
Output for 5.6.8
NO u flag: 4.506111ms WITH u flag: 58.465958ms
Output for 5.6.7
NO u flag: 4.810095ms WITH u flag: 58.724880ms
Output for 5.6.6
NO u flag: 5.592108ms WITH u flag: 66.640854ms
Output for 5.6.5
NO u flag: 6.994963ms WITH u flag: 76.205015ms
Output for 5.6.4
NO u flag: 7.541895ms WITH u flag: 78.714132ms
Output for 5.6.3
NO u flag: 5.422831ms WITH u flag: 61.081886ms
Output for 5.6.2
NO u flag: 7.615089ms WITH u flag: 72.479963ms
Output for 5.6.1
NO u flag: 7.092953ms WITH u flag: 79.289913ms
Output for 5.6.0
NO u flag: 5.692005ms WITH u flag: 65.445900ms