In theory, yes, you're right. Perhaps the PHP team can jigger preg_replaceparse the transmitted pattern, and then use the code for str_replaceif it does not see the metacharacters. Assuming the analysis is not too heavy, this one may provide better results.
However, the way to organize the PHP source code (i.e. the code used to implement PHP) is not suitable for this sharing. PHP (in some way) has less complete language and more set of modules.
So, initially the PHP team chose to stay away from this kind of cross-module experiment. At this stage, changing the function preg_replaceto perform such an analysis can lead to a violation of a large amount of code, and performance improvements will be minor.
, - , . ,
'/123/'
,
123
/123/
, .
, PHP, , .