Re: New string functions: str_startswith() and str_endswith()

From: Date: Mon, 21 Jul 2008 19:08:54 +0000
Subject: Re: New string functions: str_startswith() and str_endswith()
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-39140@lists.php.net to get a copy of this message
Hi!
It also isn't any shorter: if(str_endswith($path,'.php')) vs. if(substr($path,-4)=='.php')
Doesn't substr allocate new string for ".php"? Then endswith can have one advantage of not requiring any new allocations. Not sure it's enough to add it, but a point here to consider. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#39140) next »