summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionClass_newInstance_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/ReflectionClass_newInstance_001.phpt')
-rw-r--r--ext/reflection/tests/ReflectionClass_newInstance_001.phpt25
1 files changed, 11 insertions, 14 deletions
diff --git a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt
index afa278a9a1..e29cc8734f 100644
--- a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt
+++ b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt
@@ -42,9 +42,16 @@ $a1 = $rcA->newInstance();
$a2 = $rcA->newInstance('x');
var_dump($a1, $a2);
-$b1 = $rcB->newInstance();
-$b2 = $rcB->newInstance('x', 123);
-var_dump($b1, $b2);
+try {
+ var_dump($rcB->newInstance());
+} catch (Throwable $e) {
+ echo "Exception: " . $e->getMessage() . "\n";
+}
+try {
+ var_dump($rcB->newInstance('x', 123));
+} catch (Throwable $e) {
+ echo "Exception: " . $e->getMessage() . "\n";
+}
try {
$rcC->newInstance();
@@ -78,20 +85,10 @@ object(A)#%d (0) {
}
object(A)#%d (0) {
}
-
-Warning: Missing argument 1 for B::__construct() in %s on line 9
-
-Warning: Missing argument 2 for B::__construct() in %s on line 9
-
-Notice: Undefined variable: a in %s on line 10
-
-Notice: Undefined variable: b in %s on line 10
-In constructor of class B with args ,
+Exception: Too few arguments to function B::__construct(), 0 passed and exactly 2 expected
In constructor of class B with args x, 123
object(B)#%d (0) {
}
-object(B)#%d (0) {
-}
Access to non-public constructor of class C
Access to non-public constructor of class D
object(E)#%d (0) {