[TYPO3-core] RFC: function cmpIPv4 - PHP 5.1.12 warning with wrong usage of array index

Franz Holzinger franz at fholzinger.com
Fri Jun 30 12:49:58 CEST 2006


Hello Martin,

>Franz Holzinger schrieb:
>  
>
>>Description:
>>
>>The following line causes a lot of the same error message in PHP 5.1.12.
>>You will get this on the screen with phpMyAdmin if you have turned on
>>the display of error messages in php.ini and the install tool.
>>
>>functions cmpIPv4 and cmpIPv6
>>
>>list($test,$mask) = explode('/',$test);
>>    
>>
>
>So can avoid all the changes from $test to $testArray (testef with E_ALL).
>
>$test = explode('/',$test);
>$mask = (isset($test[1])) ? $test[1] : '';
>$test = $test[0];
>
>  
>
This works fine without any warning message now. See new patch.

>But it's going to be a PITA if we try to avoid *notices*. If you notices 
>such stuff how about all the unitinitalited-variables warnings which must 
>be all over the place.
>
>
>  
>
I do not receive other warning messages link unitialized variables.
However I receive the foreach wrong argument warnings if it happens.
But it is helpful to correct this because warning messages can help to
find some real bugs. Developers should turn the display of warning
messages on. Many error reporters will copy such messages into the
bugtracker. Therefore the code should not produce them.


- Franz








-------------- next part --------------
A non-text attachment was scrubbed...
Name: class.t3lib_div.diff
Type: text/x-patch
Size: 823 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060630/aa390e48/attachment.bin 


More information about the TYPO3-team-core mailing list