xref: /PHP-7.3/Zend/tests/bug40621.phpt (revision 782352c5)
1--TEST--
2Bug #40621 (Crash when constructor called inappropriately (statically))
3--FILE--
4<?php
5
6class Foo {
7	private function __construct() { }
8	function get() {
9		self::__construct();
10	}
11}
12
13Foo::get();
14
15echo "Done\n";
16?>
17--EXPECTF--
18Deprecated: Non-static method Foo::get() should not be called statically in %s on line %d
19
20Fatal error: Uncaught Error: Non-static method Foo::__construct() cannot be called statically in %s:%d
21Stack trace:
22#0 %s(%d): Foo::get()
23#1 {main}
24  thrown in %s on line %d
25