[TYPO3-dev] Extensions need update for 4.3!

ries van Twisk typo3 at rvt.dds.nl
Thu Oct 9 18:12:56 CEST 2008


On Oct 9, 2008, at 10:51 AM, Dmitry Dulepov wrote:

> Hi!
>
> ries van Twisk wrote:
>> It's a point, but not a good point...
>>
>> TYPO3 never made it clear about the ability of passing NULL as a  
>> 'value'.
>> it does indeed say array, but it's not clear of not allowing to  
>> pass NULL.
>> Since NULL's where always accepted by the core, a developer can only
>> assume it was allowed.
>
> Strange. If it says "array", how NULL becomes valid? Why don't you  
> pass "false" or "0" or just empty string?

We all know as programmers that NULL is special, it doesn't define a  
specific type.
That is why this is perfect valid PHP:

<?php


function test1(array $test=null) {
print 'I am here';
}

$array1[1] = 'Test';
test1($array1); // <-- no exception
test1(null);   // <-- No exception
test1('Ries');  // <-- Catchable fatal error: Argument 1 passed to  
test1() must be an array, string given, called in .....
?>


And there is nothing in PHP that prevents you to pass NULL even though  
you can explicately define in the function a array needs to be passed.

This is what Ernesto is trying to tell.

Ries









More information about the TYPO3-dev mailing list