We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d60ada5 commit 2dd7110Copy full SHA for 2dd7110
src/main/php/lang/reflection/Constructor.class.php
@@ -42,7 +42,11 @@ public function newInstance(array $args= []) {
42
// invoke after creating an instance without invoking the constructor.
43
if (!$this->reflect->isPublic()) {
44
$instance= $this->class->newInstanceWithoutConstructor();
45
- $this->reflect->setAccessible(true);
+
46
+ // TODO: Remove superfluous call to setAccessible() if on PHP8.1+
47
+ // see https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
48
+ PHP_VERSION_ID < 80100 && $this->reflect->setAccessible(true);
49
50
$this->reflect->invokeArgs($instance, $pass);
51
return $instance;
52
} else {
0 commit comments