xref: /PHP-7.4/tests/classes/final_ctor1.phpt (revision 6ef92162)
1--TEST--
2ZE2 cannot override final __construct
3--FILE--
4<?php
5
6class Base
7{
8	public final function __construct()
9	{
10	}
11}
12
13class Works extends Base
14{
15}
16
17class Extended extends Base
18{
19	public function Extended()
20	{
21	}
22}
23
24ReflectionClass::export('Extended');
25
26?>
27--EXPECTF--
28Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Extended has a deprecated constructor in %s on line %d
29
30Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d
31