Re: Optimizing php_html_entities()
| From: | Stanislav Malyshev | Date: | Tue, 23 Jun 2015 21:46:07 +0000 |
| Subject: | Re: Optimizing php_html_entities() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86818@lists.php.net to get a copy of this message | ||
Hi!
> Current php_html_entities() convert int/float/etc to string, then convert
> it.
> int/float/etc is not required to be escaped. Optimize it by simply
> converting them to string.
I'm not sure this is the case that is used frequently enough to actually
optimize for it in PHP code. If for particular app it is in the hot
path, wouldn't it be easier to just add a if(is_numeric()) or is_int()
check?
--
Stas Malyshev
smalyshev@gmail.com