简体   繁体   English

PHP 版本 4:: 解析错误:语法错误,意外 '=',期待 ')'

[英]PHP version 4 :: Parse error: syntax error, unexpected '=', expecting ')'

This function working properly with the newer PHP versions:此 function 与较新的 PHP 版本正常工作:

function MKDSLD($mkD,&$slD=array()){}

BUT

I'm getting:我越来越:

Parse error: syntax error, unexpected '=', expecting ')'

With PHP 4.使用 PHP 4。

Needless to say that I got to solve it under the older version of PHP:)不用说我得在老版本的PHP下解决了:)

Pretty simple but I guess small tweak is needed here:D很简单,但我想这里需要做一些小调整:D

Thank you in advance !先感谢您 !

PHP 4 doesn't support default parameters for reference parameters. PHP 4 不支持参考参数的默认参数。

You should deal with $slD as a required argument:您应该将$slD作为必需参数处理:

function MKDSLD($mkD, &$slD){
    // code
}


$x = array();
MKDSLD(5, $x);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解析错误:语法错误,意外的'[',期望')',可能是PHP版本问题 - Parse error: syntax error, unexpected '[', expecting ')', possibly PHP version issue 解析错误:语法错误,意外的 '[',期待 ')' php - Parse error: syntax error, unexpected '[', expecting ')' php PHP解析错误:语法错误,意外的“:”,期待“;” 或者 '{' - PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' 解析错误:语法错误,意外的“|”,期望变量(T_VARIABLE)Symfony PHP VERSION WAMP Windows - Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) Symfony PHP VERSION WAMP Windows PHP版本5.2.14 /解析错误:语法错误,意外的T_FUNCTION,期望')' - PHP Version 5.2.14 / Parse error: syntax error, unexpected T_FUNCTION, expecting ')' Wordpress插件PHP解析错误:语法错误,意外的“ {”,预期为“)” - Wordpress plugin PHP Parse error: syntax error, unexpected '{', expecting ')' 解析错误:语法错误,意外的';',期望的是')'(Wordpress functions.php) - Parse error: syntax error, unexpected ';', expecting ')' (Wordpress functions.php) PHP解析错误:语法错误,意外的T_IS_EQUAL,预期 - PHP Parse error: syntax error, unexpected T_IS_EQUAL, expecting 的PHP-语法错误,意外的'(',期待')' - php - syntax error, unexpected '(', expecting ')' 解析错误:语法错误,意外的'{',需要'('帮助? - Parse error: syntax error, unexpected '{', expecting '(' help?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM