Skip navigation

Ran across another poorly worded error message in PHP today:

<b>Notice</b>:  Object of class LoyaltyReply to string conversion in <b>/home/xxxxxx/public_html/xxxxx/LoyaltyReply.php</b> on line <b>222</b><br /

My line in question was checking to see if the varible was set, it was not doing any string conversion whatsoever. FYI, this server is still on PHP 5.1.6 and you will only get this message if you have notices enabled in your php.ini

error_reporting = E_ALL & ~E_NOTICE

The fix was quite easy:

if (isset($$this->session_info->bad_pos_datetime)) {

Just remove that extra ‘$’ and everything was fine.

Leave a Reply

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