1--TEST-- 2Check for inherited old-style constructor. 3--FILE-- 4<?php 5 class A 6 { 7 function A() 8 { 9 echo "In " . __METHOD__ . "\n"; 10 } 11 } 12 13 class B extends A 14 { 15 } 16 17 class C extends B 18 { 19 } 20 21 22 echo "About to construct new B: \n"; 23 $b = new B; 24 25 echo "Is B::B() callable?\n"; 26 var_dump(is_callable(array($b, "B"))); 27 28 echo "Is B::A() callable?\n"; 29 var_dump(is_callable(array($b, "A"))); 30 31 echo "About to construct new C: \n"; 32 $c = new C; 33 34 echo "Is C::A() callable?\n"; 35 var_dump(is_callable(array($c, "A"))); 36 37 echo "Is C::B() callable?\n"; 38 var_dump(is_callable(array($c, "B"))); 39 40 echo "Is C::C() callable?\n"; 41 var_dump(is_callable(array($c, "C"))); 42?> 43--EXPECTF-- 44Deprecated: 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 45About to construct new B: 46In A::A 47Is B::B() callable? 48bool(false) 49Is B::A() callable? 50bool(true) 51About to construct new C: 52In A::A 53Is C::A() callable? 54bool(true) 55Is C::B() callable? 56bool(false) 57Is C::C() callable? 58bool(false) 59