- Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14, 8.4.1
- Hey, I'm an instance of class A!
<?php
class A {
private function __construct() {}
public function test() {
print("Hey, I'm an instance of class A!");
}
}
$reflClass = new ReflectionClass(A::class);
$instance = $reflClass->newInstanceWithoutConstructor();
$instance->test();