xref: /PHP-7.2/ext/reflection/tests/bug30148.phpt (revision 6ef92162)
1--TEST--
2Reflection Bug #30148 (ReflectionMethod->isConstructor() fails for inherited classes)
3--FILE--
4<?php
5
6class Root
7{
8	function Root() {}
9}
10class Base extends Root
11{
12	function __construct() {}
13}
14class Derived extends Base
15{
16}
17$a = new ReflectionMethod('Root','Root');
18$b = new ReflectionMethod('Base','Root');
19$c = new ReflectionMethod('Base','__construct');
20$d = new ReflectionMethod('Derived','Root');
21$e = new ReflectionMethod('Derived','__construct');
22var_dump($a->isConstructor());
23var_dump($b->isConstructor());
24var_dump($c->isConstructor());
25var_dump($d->isConstructor());
26var_dump($e->isConstructor());
27?>
28===DONE===
29--EXPECTF--
30Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Root has a deprecated constructor in %s on line %d
31bool(true)
32bool(false)
33bool(true)
34bool(false)
35bool(true)
36===DONE===
37