|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-29 05:03 UTC] grzegorz129 at gmail dot com
[2010-08-30 18:26 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-08-30 18:26 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 09 13:00:01 2025 UTC |
Description: ------------ First of all - I marked it as feature/chamge request (not bug) bcs it`s not so important but maybe it`s a bug. Official manual quote: "The default value must be a constant expression, not (for example) a variable, a class member or a function call." Code written below is correct according to the documentation but interpreter generate parse error: syntax error, unexpected '.', expecting ')' function foobar($a = "abc"."def") { print($a); } //Wynik: Parse error: syntax error, unexpected '.', expecting ')' Test script: --------------- define("TEST", "abc"); function foo($a = TEST) { print($a); } //Res: abc function bar($a = "def") { print($a); } //Res: def function foobar($a = TEST."def") { print($a); } //Wynik: Parse error: syntax error, unexpected '.', expecting ')' //abstract but also causes parse error function foobar($a = "abc"."def") { print($a); } //Wynik: Parse error: syntax error, unexpected '.', expecting ')'