images). (cmb)
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
-- 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)
+ . Reverted prepending \ for class names. (Trowski)
- Standard:
. Fixed bug #72920 (Accessing a private constant using constant() creates
should match). (cmb).
. Add ReflectionNamedType::getName(). This method should be used instead of
ReflectionType::__toString()
+ . Prepend \ for class names and ? for nullable types returned from
+ ReflectionType::__toString(). (Trowski)
- 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);
- RETURN_STR(reflection_type_name(param));
+ str = reflection_type_name(param);
+
+ 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);
}
/* }}} */
?>
--EXPECTF--
string(11) "Traversable"
-string(11) "Traversable"
-string(6) "string"
+string(12) "?Traversable"
string(6) "string"
+string(7) "?string"
string(4) "Test"
+string(5) "?Test"
string(4) "Test"
-string(4) "Test"
-string(4) "Test"
+string(5) "?Test"
var_dump((string)$ra);
}
}
+
+?>
--EXPECT--
*** functions
** Function 0 - Parameter 0
bool(true)
bool(true)
bool(false)
-string(8) "stdClass"
+string(9) "?stdClass"
** Function 0 - Parameter 4
bool(false)
** Function 0 - Parameter 5