. ldap_control_paged_result_response and ldap_control_paged_result are
deprecated. Pagination controls can be sent along with ldap_search instead.
+- Reflection:
+ . Calls to ReflectionType::__toString() now generate a deprecation notice.
+ This method has been deprecated in favor of ReflectionNamedType::getName()
+ in the documentation since PHP 7.1, but did not throw a deprecation notice
+ for technical reasons.
+
========================================
5. Changed Functions
========================================
function a() : object {}
$returnTypeOne = (new ReflectionClass(One::class))->getMethod('a')->getReturnType();
-var_dump($returnTypeOne->isBuiltin(), (string)$returnTypeOne);
+var_dump($returnTypeOne->isBuiltin(), $returnTypeOne->getName());
$returnTypeTwo = (new ReflectionClass(Two::class))->getMethod('a')->getReturnType();
-var_dump($returnTypeTwo->isBuiltin(), (string)$returnTypeTwo);
+var_dump($returnTypeTwo->isBuiltin(), $returnTypeTwo->getName());
$returnTypea = (new ReflectionFunction('a'))->getReturnType();
-var_dump($returnTypea->isBuiltin(), (string)$returnTypea);
+var_dump($returnTypea->isBuiltin(), $returnTypea->getName());
--EXPECT--
bool(true)
string(6) "object"
function a(object $obj) {}
$typeHintOne = (new ReflectionClass(One::class))->getMethod('a')->getParameters()[0]->getType();
-var_dump($typeHintOne->isBuiltin(), (string)$typeHintOne);
+var_dump($typeHintOne->isBuiltin(), $typeHintOne->getName());
$typeHintTwo = (new ReflectionClass(Two::class))->getMethod('a')->getParameters()[0]->getType();
-var_dump($typeHintTwo->isBuiltin(), (string)$typeHintTwo);
+var_dump($typeHintTwo->isBuiltin(), $typeHintTwo->getName());
$typeHinta = (new ReflectionFunction('a'))->getParameters()[0]->getType();
-var_dump($typeHinta->isBuiltin(), (string)$typeHinta);
+var_dump($typeHinta->isBuiltin(), $typeHinta->getName());
--EXPECT--
bool(true)
string(6) "object"
$prop = $reflector->getProperty("qux");
-var_dump((string) $prop->getType());
+var_dump($prop->getType()->getName());
?>
--EXPECT--
string(3) "int"
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)
- /* 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)
+ ZEND_ME(reflection_type, __toString, arginfo_reflection__void, ZEND_ACC_DEPRECATED)
PHP_FE_END
};
var_dump((string) $return);
?>
---EXPECT--
+--EXPECTF--
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"
foreach ($reflector->getProperties() as $name => $property) {
if ($property->hasType()) {
printf("public %s $%s;\n",
- $property->getType(), $property->getName());
+ $property->getType()->getName(), $property->getName());
} else printf("public $%s;\n", $property->getName());
}
var_dump((string)(new ReflectionParameter("test", 0))->getType());
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
string(8) "iterable"