Jump to content

[SOLVED] Unsupported operand types


Brian W

Recommended Posts

Here it the error I get:

Unsupported operand types in E:\wwwroot\test\asl_reports\asl_report_functions.php on line 104

Line 104 is:

$this->sub_totals[$Initials] = $this->sub_totals[$Initials] + $Hours;

$Initials is a string that will be something like "I J M" or in my case, "B M W". At the beginning of the class, I declare "Public $sub_totals = array();", is that correct?

104 is the first time I try appending anything to the array.

 

I hope that is enough information. Any help is appreciated, thanks.

Link to comment
https://forums.phpfreaks.com/topic/153389-solved-unsupported-operand-types/
Share on other sites

it occurred to me that it may not be talking about the array... it was talking about what I was trying to add to what.

Now I'm using

$this->sub_totals[$Initials] = floatval($this->sub_totals[$Initials]) + floatval($Hours);

It works now, thanks for looking though

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.