@@ -18,6 +18,12 @@ class ThrowingUser {
18
18
}
19
19
}
20
20
21
+ abstract class AbstractClass {
22
+ public function __construct () {
23
+ return new stdClass ();
24
+ }
25
+ }
26
+
21
27
class TestUser {
22
28
public function __construct (int $ int_param , string $ string_param ) {
23
29
return new stdClass ();
43
49
} catch (\Throwable $ e ) {
44
50
echo $ e ::class, ': ' , $ e ->getMessage (), PHP_EOL ;
45
51
}
52
+ try {
53
+ $ o = zend_object_init_with_constructor ("AbstractClass " );
54
+ var_dump ($ o );
55
+ } catch (\Throwable $ e ) {
56
+ echo $ e ::class, ': ' , $ e ->getMessage (), PHP_EOL ;
57
+ }
46
58
try {
47
59
$ o = zend_object_init_with_constructor ("SysvMessageQueue " );
48
60
var_dump ($ o );
@@ -88,11 +100,12 @@ Testing impossible initializations
88
100
Error: Cannot instantiate interface _ZendTestInterface
89
101
Error: Cannot instantiate trait _ZendTestTrait
90
102
Error: Cannot instantiate enum ZendTestUnitEnum
103
+ Error: Cannot instantiate abstract class AbstractClass
91
104
Error: Cannot directly construct SysvMessageQueue, use msg_get_queue() instead
92
105
Error: Call to private PrivateUser::__construct() from global scope
93
106
Exception: Don't construct
94
107
Testing param passing
95
108
ArgumentCountError: Too few arguments to function TestUser::__construct(), 0 passed and exactly 2 expected
96
109
TypeError: TestUser::__construct(): Argument #1 ($int_param) must be of type int, string given
97
- object(TestUser)#3 (0) {
110
+ object(TestUser)#1 (0) {
98
111
}
0 commit comments