3 ms·
You can write wrapper functions in a PHP script and include it your index.php. e.g. function findFirst ($haystack, $needle, $before_needle=false, case_sensi
by frik 13y ago
You can write wrapper functions in a PHP script and include it your index.php.
e.g.
function findFirst ($haystack, $needle, $before_needle=false, case_sensitive=false) {
if (case_sensitive) {
return stristr($haystack, $needle, $before_needle);
}
return strstr($haystack, $needle, $before_needle);
}
You can submit them as RFC to https://wiki.php.net/rfc https://wiki.php.net/rfc and maybe your suggestion end up in a future version of PHP. As PHP code in HHVM is almost as fast as C++ code, your wrapper functions will be still useful for you in the meantime.