We need to free not only p here, but also b and e.
if (errors->error_count > 0) {
php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format);
retval = FAILURE;
+ if (b) {
+ timelib_time_dtor(b);
+ }
+ if (e) {
+ timelib_time_dtor(e);
+ }
if (p) {
timelib_rel_time_dtor(p);
}
echo $e->getMessage(), "\n";
}
+try {
+ new DatePeriod('2008-03-01T12:00:00Z1');
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+
?>
--EXPECT--
DateInterval::__construct(): Unknown or bad format (P3"D)
DatePeriod::__construct(): Unknown or bad format (P3"D)
+DatePeriod::__construct(): Unknown or bad format (2008-03-01T12:00:00Z1)