strange php error

7331

New Member
I have the following code:\[code\] var_dump($cumulitive); $y_axis_max = max($cumulitive)*1.3; var_dump($y_axis_max);\[/code\]It outputs the following:\[code\]array(16) { [0]=> int(0) [1]=> int(0) [2]=> int(0) [3]=> int(0) [4]=> int(0) [5]=> int(0) [6]=> int(0) [7]=> int(0) [8]=> int(0) [9]=> int(0) [10]=> int(0) [11]=> int(4) [12]=> int(4) [13]=> int(4) [14]=> int(9) [15]=> int(9)}float(NAN)\[/code\]As you can see, $y_axis_max is giving NAN. So I try this: I restart WampServer. It works now. I refresh the browser. Works again. refresh the browser again. Now it doesn't work, and I can't get it to work again without restarting Apache. From the 3rd request on it stops working.It USED to work just fine. Then I changed some things. Specifically, I modified my app to use the DateTime class in a few places. But that shouldn't make this strange error occur. Any ideas on how to debug this?If I call the $y_axis_max = .. line of code twice in a row, then I get this for $y_axis_max:\[code\]float(@.7)\[/code\]What the heck is that?EDIT: Seems that calling DateTime::diff earlier causes the error. Any workaround ideas?
 
Back
Top