2007-02-24 21:30:48 +00:00
|
|
|
--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--
|
2015-03-15 08:47:25 +00:00
|
|
|
Deprecated: Non-static method Foo::get() should not be called statically in %s on line %d
|
2007-02-24 21:30:48 +00:00
|
|
|
|
2015-05-17 22:31:43 +00:00
|
|
|
Fatal error: Uncaught Error: Non-static method Foo::__construct() cannot be called statically in %s:%d
|
2015-05-15 19:04:07 +00:00
|
|
|
Stack trace:
|
|
|
|
#0 %s(%d): Foo::get()
|
|
|
|
#1 {main}
|
|
|
|
thrown in %s on line %d
|