mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
7aacc705d0
Closes GH-5958
26 lines
343 B
PHP
26 lines
343 B
PHP
--TEST--
|
|
Implementing abstracting methods and optional parameters
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class Base
|
|
{
|
|
abstract function someMethod($param);
|
|
}
|
|
|
|
class Ext extends Base
|
|
{
|
|
function someMethod($param = "default")
|
|
{
|
|
echo $param, "\n";
|
|
}
|
|
}
|
|
|
|
$a = new Ext();
|
|
$a->someMethod("foo");
|
|
$a->someMethod();
|
|
?>
|
|
--EXPECT--
|
|
foo
|
|
default
|