开发者

PHP 4 Default Function Parameter

开发者 https://www.devze.com 2023-01-18 01:58 出处:网络
can I use this syntax under PHP 4 (default function parameter) : function myFunction($arg1 = \'defaultValue\') {}

can I use this syntax under PHP 4 (default function parameter) :

function myFunction($arg1 = 'defaultValue') {}

Thanks.开发者_开发知识库


Yes you can. And it can be overwritten like this:

<?php
$var = 'one';
myFunction($var);

function myFunction($arg1 = 'defaultValue') {
echo $arg1;
}
?>

the output would be one


Yes you definitely can do.

Hope it helps.


why don't you simply try it? yes, you can.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号