今天在寫(xiě)引用時(shí)突然出現(xiàn)了Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of getimagesize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer錯(cuò)誤,后來(lái)才知道原因是此方法已不被贊成并在 PHP/Zend 未來(lái)的版本中很可能不再支持了
解決辦法
第一種方法、 把php.ini的display_errors = on改成display_errors = off (不顯示錯(cuò)誤)
第二種方法、allow_call_time_pass_reference = Off 變成 allow_call_time_pass_reference = On
上面是對(duì)php.ini進(jìn)行修改,但是如果你沒(méi)有權(quán)限可以修改程序,下面我舉個(gè)簡(jiǎn)單的例子,可能出現(xiàn)問(wèn)題的代碼如下:
不會(huì)有問(wèn)題出現(xiàn)代碼如下: