summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-01-31 12:25:51 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-01-31 13:52:06 +0100
commitaad39879f2d2e89de105c4f87d334ee129b4321c (patch)
treec4a0615c40ddaa3596e1c29e4ccbcdf2ae197c05 /ext/reflection/tests
parent3d39479f4d7c86c66aa92fc5d0d97fb660109ee9 (diff)
downloadphp-git-aad39879f2d2e89de105c4f87d334ee129b4321c.tar.gz
Remove bareword fallback for constants
Access to undefined constants will now always result in an Error exception being thrown. This required quite a few test changes, because there were many buggy tests that unintentionally used bareword fallback in combination with error suppression.
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r--ext/reflection/tests/bug74673.phpt6
-rw-r--r--ext/reflection/tests/bug76536.phpt2
2 files changed, 2 insertions, 6 deletions
diff --git a/ext/reflection/tests/bug74673.phpt b/ext/reflection/tests/bug74673.phpt
index 8e4e8e3a18..07db9a169a 100644
--- a/ext/reflection/tests/bug74673.phpt
+++ b/ext/reflection/tests/bug74673.phpt
@@ -3,10 +3,6 @@ Bug #74673 (Segfault when cast Reflection object to string with undefined consta
--FILE--
<?php
-set_error_handler(function() {
- throw new Exception();
-});
-
class A
{
public function method($test = PHP_SELF + 1)
@@ -19,4 +15,4 @@ $class = new ReflectionClass('A');
echo $class;
?>
--EXPECTF--
-Fatal error: Method ReflectionClass::__toString() must not throw an exception, caught Exception: in %sbug74673.php on line %d
+Fatal error: Method ReflectionClass::__toString() must not throw an exception, caught Error: Undefined constant 'PHP_SELF' in %s on line %d
diff --git a/ext/reflection/tests/bug76536.phpt b/ext/reflection/tests/bug76536.phpt
index 9f3b3fdb31..aa32781e16 100644
--- a/ext/reflection/tests/bug76536.phpt
+++ b/ext/reflection/tests/bug76536.phpt
@@ -2,7 +2,7 @@
Bug #76536 (PHP crashes with core dump when throwing exception in error handler)
--FILE--
<?php
-class SomeConstants {const SOME_CONSTANT = SOME_NONSENSE;}
+class SomeConstants {const SOME_CONSTANT = "foo" % 5; }
function handleError() {throw new ErrorException();}