PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2009, PHP 5.2.9
+- Fixed explode() behavior to respect negative limit when string is empty. (shire)
- Added optional sorting type flag parameter to array_unique(), default is
SORT_REGULAR. (Andrei)
- Fixed security issue in imagerotate(), background colour isn't validated
array_init(return_value);
if (! Z_STRLEN_PP(str)) {
- add_next_index_stringl(return_value, "", sizeof("") - 1, 1);
+ if (limit >= 0 || argc == 2) {
+ add_next_index_stringl(return_value, "", sizeof("") - 1, 1);
+ }
return;
}
var_dump(@explode(NULL, a));
var_dump(@explode("abc", "acb"));
var_dump(@explode("somestring", "otherstring"));
+var_dump(@explode("somestring", "otherstring", -1));
var_dump(@explode("a", "aaaaaa"));
var_dump(@explode("==", str_repeat("-=".ord(0)."=-", 10)));
var_dump(@explode("=", str_repeat("-=".ord(0)."=-", 10)));
[0]=>
string(11) "otherstring"
}
+array(0) {
+}
array(7) {
[0]=>
string(0) ""