[TYPO3-dev] Extensions need update for 4.3!

Steffen Kamper info at sk-typo3.de
Thu Oct 9 15:50:54 CEST 2008


Hi,

Ernesto Baschny [cron IT] schrieb:
> Steffen Kamper wrote: on 09.10.2008 15:29:
> 
>> i see the point, but this is a workaround for a wrong call.
>> The function was declared all the time to be used with arrays, so if an
>> extension calls it with NULL it is (and was) wrong.
>>
>> Sure, php4 wasn't that fussy with wrong types, php5 is.
>>
>> So throwing this error is good imho to educate the devs for using API
>> the right way.
>>
>> If you don't like the error message you can switch off displayErrors of
>> coarse.
> 
> I am more for a road in between. Educate the devs is ok, but still keep
> it working for the (bigger) masses. :)
> 
> The API (meaning the "code") always allowed "NULL" values to be passed
> as parameters, that has not changed even with PHP5. There was no type
> hinting before (4.2 works fine in PHP5, not extension broke). We gain
> nothing in changing it now apart from the fact that some extensions will
> stop working. I don't see a reason to do that. We could stop people
> passing strings or integers, that is ok ("education"), my suggestion was
> exactly that: allow only arrays AND the NULL value (nothing else). Won't
> break any extension, we still have type hinting, everybody happy?
> 
> We need to use some common sense here and there in those kind of stuff.
> 
> Ernesto

ok, it make sense to allow NULL with casting, make a patch for it and i 
will vote.

As at the beginning the check is anyway
// If not arrays then set them
if (!is_array($markContentArray))	$markContentArray=array();		if 
(!is_array($subpartContentArray))	$subpartContentArray=array();		if 
(!is_array($wrappedSubpartContentArray)) 
$wrappedSubpartContentArray=array();

so it's only the type casting

vg Steffen




More information about the TYPO3-dev mailing list