xref: /PHP-8.0/ext/date/tests/bug33869.phpt (revision f8d79582)
1--TEST--
2Bug #33869 (strtotime() doesn't parse "+1days" format)
3--FILE--
4<?php
5    date_default_timezone_set("UTC");
6    $tm = strtotime("2005-01-01 01:01:01");
7    echo date(DATE_ISO8601, strtotime('+5days', $tm));
8    echo "\n";
9    echo date(DATE_ISO8601, strtotime('+1month', $tm));
10    echo "\n";
11    echo date(DATE_ISO8601, strtotime('+1year', $tm));
12    echo "\n";
13    echo date(DATE_ISO8601, strtotime('+5 days', $tm));
14    echo "\n";
15    echo date(DATE_ISO8601, strtotime('+1 month', $tm));
16    echo "\n";
17    echo date(DATE_ISO8601, strtotime('+1 year', $tm));
18    echo "\n";
19?>
20--EXPECT--
212005-01-06T01:01:01+0000
222005-02-01T01:01:01+0000
232006-01-01T01:01:01+0000
242005-01-06T01:01:01+0000
252005-02-01T01:01:01+0000
262006-01-01T01:01:01+0000
27