[TYPO3-core] RFC: #15440: isFirstPartOfStr doesn't work with non-strings
Steffen Kamper
info at sk-typo3.de
Thu Aug 12 22:59:47 CEST 2010
Hi Bernhard,
Bernhard Kraft schrieb:
> Am 2010-08-12 15:05, schrieb Steffen Kamper:
>
>> sry - totally forgot #15002 which does the performance improvement.
>
> I first read your other patch and now saw this version. I already wanted
> to rant. Now I give my +1 by reading.
>
one testing still is missing, you can do it with the unit test :)
> I tought about using this php function:
>
> http://de.php.net/manual/en/function.strncmp.php
>
> But "strpos" seems to be more readable for implementing a method named
> "isFirstPartOfStr".
>
> BTW: If some of you always have the problem to remember: What was which
> argument in strpos, or in_array, I have a simple rule. You surely now
> the phrase: To search for a needle in a hay stack. In German "Die Nadel
> im Heuhaufe suchen". For "in_arr(h)ay" :) The order is exactly those
> "needle, haystack". And for strings its simple inverted. haystack,
> needle. Hope, by this mnemonic you do not have to look the documentation
> up for every use and save your time.
>
>
nice one. But next time i think - was it with strings or array, so i
will look up this again and again :)
vg Steffen
More information about the TYPO3-team-core
mailing list