. ReflectionFunction::isDisabled() is deprecated, as it is no longer possible
to create a ReflectionFunction for a disabled function. This method now
always returns false.
+ . ReflectionParameter::getClass(), ReflectionParameter::isArray(), and
+ ReflectionParameter::isCallable() are deprecated.
+ ReflectionParameter::getType() and the ReflectionType APIs should be used
+ instead.
========================================
5. Changed Functions
$r = new ReflectionMethod($f, '__invoke');
var_dump($r->getParameters()[0]->getClass());
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(11) "Traversable"
var_dump($rc->getParameters()[0]->isCallable());
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::isCallable() is deprecated in %s on line %d
bool(true)
+
+Deprecated: Function ReflectionParameter::isCallable() is deprecated in %s on line %d
bool(true)
+
+Deprecated: Function ReflectionParameter::isCallable() is deprecated in %s on line %d
bool(true)
+++ /dev/null
---TEST--
-Bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone
---SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
---FILE--
-<?php
-$f = new ReflectionFunction('intltz_from_date_time_zone');
-var_dump($f->getParameters()[0]->getClass());
-
-?>
---EXPECTF--
-object(ReflectionClass)#%d (1) {
- ["name"]=>
- string(12) "DateTimeZone"
-}
/** @return ReflectionClass|null */
public function getDeclaringClass() {}
- /** @return ReflectionClass|null */
+ /**
+ * @return ReflectionClass|null
+ * @deprecated Use ReflectionParameter::getType() instead
+ */
public function getClass() {}
/** @return bool */
/** @return ReflectionType|null */
public function getType() {}
- /** @return bool */
+ /**
+ * @return bool
+ * @deprecated Use ReflectionParameter::getType() instead
+ */
public function isArray() {}
- /** @return bool */
+ /**
+ * @return bool
+ * @deprecated Use ReflectionParameter::getType() instead
+ */
public function isCallable() {}
/** @return bool */
ZEND_ME(ReflectionParameter, canBePassedByValue, arginfo_class_ReflectionParameter_canBePassedByValue, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, getDeclaringFunction, arginfo_class_ReflectionParameter_getDeclaringFunction, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, getDeclaringClass, arginfo_class_ReflectionParameter_getDeclaringClass, ZEND_ACC_PUBLIC)
- ZEND_ME(ReflectionParameter, getClass, arginfo_class_ReflectionParameter_getClass, ZEND_ACC_PUBLIC)
+ ZEND_ME(ReflectionParameter, getClass, arginfo_class_ReflectionParameter_getClass, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
ZEND_ME(ReflectionParameter, hasType, arginfo_class_ReflectionParameter_hasType, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, getType, arginfo_class_ReflectionParameter_getType, ZEND_ACC_PUBLIC)
- ZEND_ME(ReflectionParameter, isArray, arginfo_class_ReflectionParameter_isArray, ZEND_ACC_PUBLIC)
- ZEND_ME(ReflectionParameter, isCallable, arginfo_class_ReflectionParameter_isCallable, ZEND_ACC_PUBLIC)
+ ZEND_ME(ReflectionParameter, isArray, arginfo_class_ReflectionParameter_isArray, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
+ ZEND_ME(ReflectionParameter, isCallable, arginfo_class_ReflectionParameter_isCallable, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
ZEND_ME(ReflectionParameter, allowsNull, arginfo_class_ReflectionParameter_allowsNull, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, getPosition, arginfo_class_ReflectionParameter_getPosition, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, isOptional, arginfo_class_ReflectionParameter_isOptional, ZEND_ACC_PUBLIC)
var_dump($parameter->isArray());
}
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
+
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
+
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
+
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
var_dump($class->getName());
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
string(3) "Foo"
}
echo "ok\n";
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
__autoload(A)
A
ok
$refParam = new ReflectionParameter(array('stubParamTest', 'paramTest'), 'param');
var_dump($refParam->getClass());
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(13) "stubParamTest"
echo $r->getReturnType()->getName(), "\n";
echo $r,"\n";
?>
---EXPECT--
+--EXPECTF--
string(1) "x"
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(8) "stdClass"
check_params(new ReflectionMethod('test::method'));
?>
---EXPECT--
+--EXPECTF--
#####test()#####
===0===
getName: string(3) "nix"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===1===
getName: string(2) "ar"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
-isArray: bool(true)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(true)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===2===
getName: string(3) "ref"
isPassedByReference: bool(true)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===3===
getName: string(3) "std"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===4===
getName: string(2) "na"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
Class NonExistingClass does not exist
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===5===
getName: string(3) "opt"
isPassedByReference: bool(true)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(true)
isDefaultValueAvailable: bool(true)
===6===
getName: string(3) "def"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(true)
isDefaultValueAvailable: bool(true)
===0===
getName: string(3) "nix"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===1===
getName: string(2) "ar"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
-isArray: bool(true)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(true)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===2===
getName: string(3) "ref"
isPassedByReference: bool(true)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===3===
getName: string(3) "std"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===4===
getName: string(2) "na"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
Class NonExistingClass does not exist
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(false)
isOptional: bool(false)
isDefaultValueAvailable: bool(false)
===5===
getName: string(3) "opt"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(true)
isDefaultValueAvailable: bool(true)
===6===
getName: string(3) "def"
isPassedByReference: bool(false)
+
+Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
-isArray: bool(false)
+isArray:
+Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+bool(false)
allowsNull: bool(true)
isOptional: bool(true)
isDefaultValueAvailable: bool(true)