[TYPO3-core] RFC: #15440: isFirstPartOfStr doesn't work with non-strings

Bernhard Kraft kraftb at think-open.at
Thu Aug 12 22:43:19 CEST 2010


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.

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.



greetings,
Bernhard



More information about the TYPO3-team-core mailing list