mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
e3c4c2496c
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
|