首頁  >  問答  >  主體

PHP 解析錯誤:語法錯誤,意外'

當我從 php 5.6 更改為 php 7.4 時,我收到此錯誤:

PHP 解析錯誤:語法錯誤,意外的“[”,期望“;”或 ./dbdrivers/odbc.php IN $$args[1]

中的 ','
function &db_fetch_row ($args=array()){
     global $$args[1];

     switch(count($args)) {
     case 2:
             return (odbc_fetch_into($args[0], $args[1]));
     default:
             return (odbc_fetch_array($args[0]));
     }
}

P粉183077097P粉183077097188 天前268

全部回覆(1)我來回復

  • P粉986937457

    P粉9869374572024-03-20 12:48:54

    您必須指定

    ${$args[1]}

    #或

    ${$args}[1]

    https://www.php.net/manual/en /語言.variables.variable.php

    #

    回覆
    0
  • 取消回覆