[TYPO3-core] RFC #15002: Enhancement of t3lib_div::isFirstPartOfStr

Gosign | Caspar Stuebs caspar at gosign.de
Mon Jul 5 18:39:43 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I am not sure if this still matches the CGL, but I would write the
function like this:

function isFirstPartOfStrNew ($str, $partStr) {
   return (boolean)($partStr !== '' && strpos($str, $partStr, 0) === 0);
}

This is as fast as the first given function. see test below.

Regardless of my suggestion

+1 by reading and testing

Regards
Caspar

- ------------------------------------------------------------------------

_______________________________________________
Before posting to this list, please have a look to the posting rules
on the following websites:

http://typo3.org/teams/core/core-mailinglist-rules/
http://typo3.org/development/bug-fixing/diff-and-patch/
_______________________________________________
TYPO3-team-core mailing list
TYPO3-team-core at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwyCs8ACgkQBN8gVNLcSL7aYQCgkxsCg/TcxC9Mio/6V67bU1s5
ZBoAnj8gMyrFvNRZsKhtiBvgh6d/Mcne
=N+rw
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100705/c35cbcca/attachment-0001.htm>


More information about the TYPO3-team-core mailing list