xref: /PHP-7.4/Zend/tests/bug52160.phpt (revision 6d6d954d)
1--TEST--
2Bug #52160 (Invalid E_DEPRECATED redefined constructor error)
3--FILE--
4<?php
5
6class bar {
7	function __construct() { }
8	static function bar() {
9		var_dump(1);
10	}
11}
12
13bar::bar();
14
15class foo {
16	static function foo() {
17		var_dump(2);
18	}
19	function __construct() { }
20}
21
22foo::foo();
23
24class baz {
25	static function baz() {
26		var_dump(3);
27	}
28}
29
30?>
31--EXPECTF--
32Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; baz has a deprecated constructor in %s on line %d
33
34Fatal error: Constructor baz::baz() cannot be static in %s on line %d
35