I was using a binary with the new timelib. Undo the datetime tests
[hiphop-php.git] / hphp / test / zend / bad / ext-date / date_add_basic.php
blobcec5ff21aa702c145383ccb0f06456c413d8f374
1 <?php
2 date_default_timezone_set('UTC');
3 /* Prototype : void date_add(DateTime object, DateInterval interval)
4 * Description: Adds an interval to the current date in object.
5 * Source code: ext/date/php_date.c
6 * Alias to functions:
7 */
9 echo "*** Testing date_add() : basic functionality ***\n";
11 // Initialise all required variables
12 $startDate = '2008-01-01 12:25';
13 $format = 'Y-m-d H:i:s';
14 $intervals = array(
15 'P3Y6M4DT12H30M5S',
16 'P0D',
17 'P2DT1M',
18 'P1Y2MT23H43M150S'
21 $d = new DateTime($startDate);
22 var_dump( $d->format($format) );
24 foreach($intervals as $interval) {
25 date_add($d, new DateInterval($interval) );
26 var_dump( $d->format($format) );
30 ===DONE===