1--TEST-- 2Ensure inherited old-style constructor doesn't block other methods 3--FILE-- 4<?php 5class A { 6 public function B () { echo "In " . __METHOD__ . "\n"; } 7 public function A () { echo "In " . __METHOD__ . "\n"; } 8} 9class B extends A { } 10 11$rc = new ReflectionClass('B'); 12var_dump($rc->getMethods()); 13 14 15$b = new B(); 16$b->a(); 17$b->b(); 18 19?> 20--EXPECTF-- 21Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d 22array(2) { 23 [0]=> 24 object(ReflectionMethod)#%d (2) { 25 ["name"]=> 26 string(1) "B" 27 ["class"]=> 28 string(1) "A" 29 } 30 [1]=> 31 object(ReflectionMethod)#%d (2) { 32 ["name"]=> 33 string(1) "A" 34 ["class"]=> 35 string(1) "A" 36 } 37} 38In A::A 39In A::A 40In A::B 41