summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-04-24 10:58:10 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-14 17:23:31 +0200
commit93640db4d5ca4e41079577a03cf969fa6c63d533 (patch)
tree62062db09fc295b66a5d7dca3f1254406306af3f /ext
parent4bc1cf29287fd73ced0f93f713fe93e421465cd7 (diff)
downloadphp-git-93640db4d5ca4e41079577a03cf969fa6c63d533.tar.gz
Improve error message for deprecated methods
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/jit/zend_jit_vm_helpers.c7
-rw-r--r--ext/reflection/tests/ReflectionClass_isArray.phpt8
-rw-r--r--ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt2
-rw-r--r--ext/reflection/tests/bug26695.phpt2
-rw-r--r--ext/reflection/tests/bug29268.phpt2
-rw-r--r--ext/reflection/tests/bug39884.phpt2
-rw-r--r--ext/reflection/tests/bug69802.phpt2
-rw-r--r--ext/reflection/tests/parameters_002.phpt56
8 files changed, 40 insertions, 41 deletions
diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c
index c766aaaadd..4a15dca129 100644
--- a/ext/opcache/jit/zend_jit_vm_helpers.c
+++ b/ext/opcache/jit/zend_jit_vm_helpers.c
@@ -157,10 +157,9 @@ void ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D)
{
zend_execute_data *call = (zend_execute_data *) opline;
zend_function *fbc = call->func;
- zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
- fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
- fbc->common.scope ? "::" : "",
- ZSTR_VAL(fbc->common.function_name));
+
+ zend_deprecated_function(fbc);
+
if (EG(exception)) {
#ifndef HAVE_GCC_GLOBAL_REGS
zend_execute_data *execute_data = EG(current_execute_data);
diff --git a/ext/reflection/tests/ReflectionClass_isArray.phpt b/ext/reflection/tests/ReflectionClass_isArray.phpt
index 4166ae71cc..67df4e98e7 100644
--- a/ext/reflection/tests/ReflectionClass_isArray.phpt
+++ b/ext/reflection/tests/ReflectionClass_isArray.phpt
@@ -14,14 +14,14 @@ foreach ($reflection->getParameters() as $parameter) {
}
?>
--EXPECTF--
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
diff --git a/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt b/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt
index d634927516..9cc7eaa31f 100644
--- a/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt
+++ b/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt
@@ -20,5 +20,5 @@ var_dump($rf->isDisabled());
--EXPECTF--
Function is_file() does not exist
-Deprecated: Function ReflectionFunction::isDisabled() is deprecated in %s on line %d
+Deprecated: Method ReflectionFunction::isDisabled() is deprecated in %s on line %d
bool(false)
diff --git a/ext/reflection/tests/bug26695.phpt b/ext/reflection/tests/bug26695.phpt
index 66766c5ebb..2f50e2151c 100644
--- a/ext/reflection/tests/bug26695.phpt
+++ b/ext/reflection/tests/bug26695.phpt
@@ -20,5 +20,5 @@ $class = $params[0]->getClass();
var_dump($class->getName());
?>
--EXPECTF--
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
string(3) "Foo"
diff --git a/ext/reflection/tests/bug29268.phpt b/ext/reflection/tests/bug29268.phpt
index f46829be97..4bb12819bc 100644
--- a/ext/reflection/tests/bug29268.phpt
+++ b/ext/reflection/tests/bug29268.phpt
@@ -22,7 +22,7 @@ foreach($parameters as $parameter)
echo "ok\n";
?>
--EXPECTF--
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
__autoload(A)
A
ok
diff --git a/ext/reflection/tests/bug39884.phpt b/ext/reflection/tests/bug39884.phpt
index 6e73066bd4..4049493028 100644
--- a/ext/reflection/tests/bug39884.phpt
+++ b/ext/reflection/tests/bug39884.phpt
@@ -16,7 +16,7 @@ $refParam = new ReflectionParameter(array('stubParamTest', 'paramTest'), 'param'
var_dump($refParam->getClass());
?>
--EXPECTF--
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(13) "stubParamTest"
diff --git a/ext/reflection/tests/bug69802.phpt b/ext/reflection/tests/bug69802.phpt
index 35a0f991fa..bf60ea0143 100644
--- a/ext/reflection/tests/bug69802.phpt
+++ b/ext/reflection/tests/bug69802.phpt
@@ -13,7 +13,7 @@ echo $r,"\n";
--EXPECTF--
string(1) "x"
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(8) "stdClass"
diff --git a/ext/reflection/tests/parameters_002.phpt b/ext/reflection/tests/parameters_002.phpt
index f4a7ca19c6..e25310a6c7 100644
--- a/ext/reflection/tests/parameters_002.phpt
+++ b/ext/reflection/tests/parameters_002.phpt
@@ -78,11 +78,11 @@ check_params(new ReflectionMethod('test::method'));
getName: string(3) "nix"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(false)
@@ -91,11 +91,11 @@ isDefaultValueAvailable: bool(false)
getName: string(2) "ar"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
allowsNull: bool(false)
isOptional: bool(false)
@@ -104,11 +104,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "ref"
isPassedByReference: bool(true)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(false)
@@ -117,11 +117,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "std"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(false)
isOptional: bool(false)
@@ -130,11 +130,11 @@ isDefaultValueAvailable: bool(false)
getName: string(2) "na"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
Class NonExistingClass does not exist
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(false)
isOptional: bool(false)
@@ -143,11 +143,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "opt"
isPassedByReference: bool(true)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(true)
@@ -157,11 +157,11 @@ getDefaultValue: NULL
getName: string(3) "def"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: NULL
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(true)
@@ -172,11 +172,11 @@ getDefaultValue: string(6) "FooBar"
getName: string(3) "nix"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(false)
@@ -185,11 +185,11 @@ isDefaultValueAvailable: bool(false)
getName: string(2) "ar"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(true)
allowsNull: bool(false)
isOptional: bool(false)
@@ -198,11 +198,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "ref"
isPassedByReference: bool(true)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(false)
@@ -211,11 +211,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "std"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(false)
isOptional: bool(false)
@@ -224,11 +224,11 @@ isDefaultValueAvailable: bool(false)
getName: string(2) "na"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
Class NonExistingClass does not exist
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(false)
isOptional: bool(false)
@@ -237,11 +237,11 @@ isDefaultValueAvailable: bool(false)
getName: string(3) "opt"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: stdClass
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(true)
@@ -251,11 +251,11 @@ getDefaultValue: NULL
getName: string(3) "def"
isPassedByReference: bool(false)
-Deprecated: Function ReflectionParameter::getClass() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
getClass: NULL
getDeclaringClass: test
isArray:
-Deprecated: Function ReflectionParameter::isArray() is deprecated in %s on line %d
+Deprecated: Method ReflectionParameter::isArray() is deprecated in %s on line %d
bool(false)
allowsNull: bool(true)
isOptional: bool(true)