簡體   English   中英

phpgraphlib php 7.1版遇到的非數字值

[英]phpgraphlib A non-numeric value encountered for php version 7.1

我使用PHPGraphLib為我的PHP版本7.0,它工作得非常好。 但是,我已將本地服務器從7.0切換到7.1,現在它已經開始給我一個錯誤說..

遇到非數字值

在/my_website_path/phpgraphlib.php第987行

因此,我去了這個特定的行,並在第987行找到了這個代碼。

$raw_size = $high_x - $low_x +1;

並將此塊代碼更改為此(參考https://github.com/elliottb/phpgraphlib/issues/30#issuecomment-394975371 )。

raw_size = $data[$high_x] - $data[$low_x] +1;

我成功地超越了這個錯誤。 但是現在我又得到了另一個錯誤說..

遇到非數字值

在/my_website_path/phpgraphlib.php第381行

我去了這里找到了這段代碼。

$xStart = $this->y_axis_x1 + ($this->space_width / 2) + ((key($data_set) - $this->lowest_x) * ($this->bar_width + $this->space_width));

並嘗試用此代碼替換。

$xStart = (float) $this->y_axis_x1 + ((float) $this->space_width / 2) + ( (float) (key(  $data_set) -  (float) $this->lowest_x) * ((float) $this->bar_width + (float) $this->space_width));

是的我無法在我的PHP版本7.1中使其工作

我試圖找到方法和研究但尚未找到適合我的方法。

我也嘗試搜索這個適用於7.1的庫,但似乎還沒有升級到php 7.1。

有人可以指導我如何克服這些問題,使它以某種方式適用於我最新的PHP版本。

最終我解決了以下線程后的錯誤。

https://github.com/LupenWonse/phpgraphlib/commit/ae815920d0790b11da28763ff599462740389097

希望這可以幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM