mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
68de75f0b5
Schneider)
25 lines
324 B
PHP
25 lines
324 B
PHP
--TEST--
|
|
Implementating 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
|