php-src/tests/classes/ctor_name_clash.phpt

24 lines
515 B
Plaintext
Raw Normal View History

2005-06-23 10:24:23 +00:00
--TEST--
ZE2 The child class can re-use the parent class name for a function member
--FILE--
<?php
class base {
function base() {
echo __CLASS__."::".__FUNCTION__."\n";
}
}
class derived extends base {
function base() {
echo __CLASS__."::".__FUNCTION__."\n";
}
}
$obj = new derived();
$obj->base();
?>
--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; base has a deprecated constructor in %s on line %d
2005-06-23 10:24:23 +00:00
base::base
derived::base