Error in php v5.2.11 but not 5.3.5
Posted: Sat Jul 16, 2011 2:05 pm
I'm getting the following error:
[text]Fatal error: Call to a member function format() on a non-object[/text]
because of the following lines:
The error is hitting on the last line: $next_due_date_f = $next_due_date->format($date_format) I get the error on V5.2.11 but not on V3.5.3.
Any ideas how I can get around this? I'm using 5.2.11 because my web host is using 5.2.15. (I'm using 5.2.11 because that is the highest 5.2.x version I can get on WAMP and I figured if it runs on 5.2.11 it will run on 5.2.15).
[text]Fatal error: Call to a member function format() on a non-object[/text]
because of the following lines:
Code: Select all
$last_due_date = new DateTime($last_payment_history['next_due']);
$interval_string = "+".$num_weeks." weeks";
// calculate the next due date based on the last due date recorded
$next_due_date = $last_due_date->modify($interval_string);
// put the date into MySQL format
$next_due_date_f = $next_due_date->format($date_format);Any ideas how I can get around this? I'm using 5.2.11 because my web host is using 5.2.15. (I'm using 5.2.11 because that is the highest 5.2.x version I can get on WAMP and I figured if it runs on 5.2.11 it will run on 5.2.15).