Created
January 29, 2022 11:13
-
-
Save shin1x1/701278a17fe0aaf03a69678c31e4bfc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = str_repeat(' ', 200000) . 'a'; | |
$start = microtime(true); | |
preg_replace('/\s+$/', '', $string); | |
if (preg_last_error() !== 0) { | |
var_dump(preg_last_error_msg()); | |
} | |
echo microtime(true) - $start, PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment