Better BC with 7.0.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016, PHP 7.1.0RC1
-- IMAP:
- . Fixed bug #72852 (imap_mail null dereference). (Anatol)
+- Reflection:
+ . Reverted prepending \ for class names and ? for nullable types returned
+ from ReflectionType::__toString(). (Trowski)
- Intl:
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
sequence). (cmb)
+- Reflection:
+ . Reverted prepending \ for class names and ? for nullable types returned
+ from ReflectionType::__toString(). (Trowski)
+
- XML:
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
- Reflection:
. Implemented request #38992 (invoke() and invokeArgs() static method calls
should match). (cmb).
- . Add ReflectionNamedType::getName() and return leading "?" for nullable types
- from ReflectionType::__toString(). (Trowski)
+ . Add ReflectionNamedType::getName(). This method should be used instead of
+ ReflectionType::__toString()
- Session:
. Implemented RFC: Session ID without hashing. (Yasuo)
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
aligned, what causes slightly different behavior than before for some
pathological cases.
- . ReflectionType::__toString() will now return the type name with a leading
- "?" if it is nullable. To retrieve the type name without leading "?" the new
- ReflectionNamedType::getName() method can be used.
========================================
2. New Features
- Reflection:
. Failure to retrieve a reflection object or retrieve an object property
will now throw an instance of Error instead of resulting in a fatal error.
+ . ReflectionNamedType will be returned from ReflectionParameter::getType()
+ and ReflectionFunctionAbstract::getReturnType(). This class includes a
+ getName() method that returns the type name as a string.
- Session:
. Custom session handlers that do not return strings for session IDs will
{
reflection_object *intern;
type_reference *param;
- zend_string *str;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(param);
- str = reflection_type_name(param);
-
- if (param->arg_info->type_hint == IS_OBJECT
- && !zend_string_equals_literal_ci(param->arg_info->class_name, "self")
- && !zend_string_equals_literal_ci(param->arg_info->class_name, "parent")) {
- size_t orig_len = ZSTR_LEN(str);
- str = zend_string_extend(str, orig_len + 1, 0);
- memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), orig_len + 1);
- ZSTR_VAL(str)[0] = '\\';
- }
-
- if (param->arg_info->allow_null) {
- size_t orig_len = ZSTR_LEN(str);
- str = zend_string_extend(str, orig_len + 1, 0);
- memmove(ZSTR_VAL(str) + 1, ZSTR_VAL(str), orig_len + 1);
- ZSTR_VAL(str)[0] = '?';
- }
-
- RETURN_STR(str);
+ RETURN_STR(reflection_type_name(param));
}
/* }}} */
?>
--EXPECTF--
string(11) "Traversable"
-string(12) "?Traversable"
+string(11) "Traversable"
+string(6) "string"
string(6) "string"
-string(7) "?string"
string(4) "Test"
-string(5) "?Test"
string(4) "Test"
-string(5) "?Test"
+string(4) "Test"
+string(4) "Test"
bool(true)
bool(true)
bool(false)
-string(9) "?stdClass"
+string(8) "stdClass"
** Function 0 - Parameter 4
bool(false)
** Function 0 - Parameter 5