Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't mark ReflectionType::__toString() as deprecated for now
  • Loading branch information
nikic committed Sep 27, 2016
commit 93f94b63959b4e87a8ff8d626a6c69eac7ca5f89
5 changes: 4 additions & 1 deletion ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -6701,7 +6701,10 @@ static const zend_function_entry reflection_type_functions[] = {
ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(reflection_type, allowsNull, arginfo_reflection__void, 0)
ZEND_ME(reflection_type, isBuiltin, arginfo_reflection__void, 0)
ZEND_ME(reflection_type, __toString, arginfo_reflection__void, ZEND_ACC_DEPRECATED)
/* ReflectionType::__toString() is deprecated, but we currently do not mark it as such
* due to bad interaction with the PHPUnit error handler and exceptions in __toString().
* See PR2137. */
ZEND_ME(reflection_type, __toString, arginfo_reflection__void, 0)
PHP_FE_END
};

Expand Down
10 changes: 1 addition & 9 deletions ext/reflection/tests/ReflectionNamedType.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,12 @@ var_dump($return->getName());
var_dump((string) $return);

?>
--EXPECTF--
--EXPECT--
string(11) "Traversable"

Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
string(11) "Traversable"
string(6) "string"

Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
string(6) "string"
string(4) "Test"

Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
string(4) "Test"
string(4) "Test"

Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
string(4) "Test"
3 changes: 1 addition & 2 deletions ext/reflection/tests/bug72661.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ function test(iterable $arg) { }

var_dump((string)(new ReflectionParameter("test", 0))->getType());
?>
--EXPECTF--
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
--EXPECT--
string(8) "iterable"