2008-12-05 22:12:07 +00:00
--TEST--
2009-04-28 10:30:56 +00:00
Ensure inherited old-style constructor doesn't block other methods
2008-12-05 22:12:07 +00:00
--FILE--
<?php
class A {
public function B () { echo "In " . __METHOD__ . "\n"; }
public function A () { echo "In " . __METHOD__ . "\n"; }
}
class B extends A { }
$rc = new ReflectionClass('B');
var_dump($rc->getMethods());
$b = new B();
$b->a();
$b->b();
?>
--EXPECTF--
2015-03-31 14:10:06 +00:00
Deprecated: 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
2008-12-05 22:12:07 +00:00
array(2) {
[0]=>
2014-03-06 21:00:26 +00:00
object(ReflectionMethod)#%d (2) {
2009-04-28 10:30:56 +00:00
["name"]=>
string(1) "B"
["class"]=>
2009-04-28 23:46:27 +00:00
string(1) "A"
2008-12-05 22:12:07 +00:00
}
[1]=>
2014-03-06 21:00:26 +00:00
object(ReflectionMethod)#%d (2) {
2009-04-28 10:30:56 +00:00
["name"]=>
string(1) "A"
["class"]=>
2009-04-28 23:46:27 +00:00
string(1) "A"
2008-12-05 22:12:07 +00:00
}
}
In A::A
In A::A
2009-04-28 10:30:56 +00:00
In A::B