PHP Fatal error: Unsupported operand types

Posted by on December 2, 2011 in PHP, Programming | 0 comments

PHP is a very flexible language, but sometimes you’re not passing it what you expect. If you’re trying to do arithmetic, PHP will handle and convert pretty much anything except an array. So chances are if you get the “Fatal error: Unsupported operand types in” error, then you’re not adding two variables that you think you are. To troubleshoot simply do a var_dump(); before the operation that it is erroring out at and make sure the variables are what you expect them to be.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>