Closed
Description
Description
Found while working on #14440
The following code:
<?php
class PrivateUser {
private function __construct() {
return new stdClass();
}
public function __destruct() {
echo 'Destructor for ', __CLASS__, PHP_EOL;
}
}
new PrivateUser();
Resulted in this output:
Destructor for PrivateUser
Fatal error: Uncaught Error: Call to private PrivateUser::__construct() from global scope in /in/EF0hE:12
Stack trace:
#0 {main}
thrown in /in/EF0hE on line 12
But I expected this output instead:
Fatal error: Uncaught Error: Call to private PrivateUser::__construct() from global scope in /in/EF0hE:12
Stack trace:
#0 {main}
thrown in /in/EF0hE on line 12
PHP Version
master
Operating System
No response