mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
22 lines
394 B
PHP
22 lines
394 B
PHP
--TEST--
|
|
Bug #40621 (Crash when constructor called inappropriately (statically))
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
private function __construct() { }
|
|
function get() {
|
|
self::__construct();
|
|
}
|
|
}
|
|
|
|
Foo::get();
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Non-static method Foo::get() cannot be called statically in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|