fix str_split

This was coming up when installing Symphony using composer, and while I was in there I fixed a zend mode bug. We weren't doing the warning in the interpreter (and we were doing null instead of uninit). That was enough to move most of the tests over. The other problem is tasked.
Esse commit está contido em:
Paul Tarjan
2013-07-23 16:54:44 -07:00
commit de Sara Golemon
commit c1af7f57f5
8 arquivos alterados com 16 adições e 4 exclusões
+3 -1
Ver Arquivo
@@ -263,7 +263,9 @@ String StringUtil::Implode(CArrRef items, CStrRef delim) {
Variant StringUtil::Split(CStrRef str, int split_length /* = 1 */) {
if (split_length <= 0) {
throw_invalid_argument("split_length: (non-positive)");
throw_invalid_argument(
"The length of each segment must be greater than zero"
);
return false;
}
+3
Ver Arquivo
@@ -398,6 +398,9 @@ bool tvCoerceParamToStringInPlace(TypedValue* tv) {
case KindOfArray:
return false;
case KindOfObject:
if (tv->m_data.pobj->isResource()) {
return false;
}
try {
tvAsVariant(tv) = tv->m_data.pobj->t___tostring();
return true;
+7 -1
Ver Arquivo
@@ -5803,7 +5803,13 @@ inline void OPTBLD_INLINE VMExecutionContext::iopFCallBuiltin(PC& pc) {
case KindOf##kind: \
if (zendParamMode) { \
if (!tvCoerceParamTo##kind##InPlace(&args[-i])) { \
ret.m_type = KindOfNull; \
raise_param_type_warning( \
func->name()->data(), \
i+1, \
KindOf##kind, \
args[-i].m_type \
); \
ret.m_type = KindOfUninit; \
goto free_frame; \
} \
} else { \
+3 -2
Ver Arquivo
@@ -471,7 +471,8 @@
"name": "str_split",
"desc": "Converts a string to an array.",
"flags": [
"HasDocComment"
"HasDocComment",
"ZendParamMode"
],
"return": {
"type": "Variant",
@@ -2290,4 +2291,4 @@
],
"classes": [
]
}
}