[TYPO3-core] RFC #11815: Saving translation: strcmp() expects parameter 2 to be string (PHP5.3)

Steffen Gebert steffen at steffen-gebert.de
Thu Sep 24 14:33:57 CEST 2009


On Fri, 28 Aug 2009 14:34:01 +0200, Steffen Gebert  
<steffen at steffen-gebert.de> wrote:

> On Fri, 28 Aug 2009 14:09:26 +0200, Steffen Kamper <info at sk-typo3.de>
> wrote:
>
>> after !array, is this type cast superfluous?
>> $settings[$key] = (string)$CHANGED_SETTINGS[$key];
>
>
> Okay.. weird. Those PHP-guys really change behavior of strcmp(*,  
> array())!
> Thanks for making me think again!
>
> Try
> echo (@strcmp('foo', array('foo')) ? "true" : "false");
> on PHP5.2 (-> true) and PHP5.3 (-> false).
>
> Therefore
> $settings[$key] = (string)$CHANGED_SETTINGS[$key];
> $changed = 1;
> was executed with 5.2 and so we have to check is_array() instead of
> !is_array() (and the cast is needed).
>
> Would be nice, if you could really have a closer look, but I'm quite sure
> it's the solution now.


Reminder


More information about the TYPO3-team-core mailing list