diff --git a/stub/oo/ooparams.zep b/stub/oo/ooparams.zep index 256f0d32a..de253ca6a 100644 --- a/stub/oo/ooparams.zep +++ b/stub/oo/ooparams.zep @@ -126,4 +126,19 @@ class OoParams { return parameter; } + + public function getDefaultParamValue(int i = 0) + { + return i; + } + + public function getDefaultParamValue1(int i = 1) + { + return i; + } + + public function getDefaultParamValueStr(string str = "default") + { + return str; + } } diff --git a/tests/Extension/Oo/OoParamsTest.php b/tests/Extension/Oo/OoParamsTest.php index 34c65a190..757e3c54b 100644 --- a/tests/Extension/Oo/OoParamsTest.php +++ b/tests/Extension/Oo/OoParamsTest.php @@ -43,6 +43,10 @@ public function testOoParams(): void $this->assertSame($this->test->setList([1, 2, 3, 4, 5]), [1, 2, 3, 4, 5]); $this->assertSame($this->test->setList([]), []); + + $this->assertSame(0, $this->test->getDefaultParamValue()); + $this->assertSame(1, $this->test->getDefaultParamValue1()); + $this->assertSame('default', $this->test->getDefaultParamValueStr()); } public function setObjectClassCast(): void