I was using a binary with the new timelib. Undo the datetime tests
[hiphop-php.git] / hphp / test / zend / bad / ext-date / date_modify_error.php
blobe6c1aae47feea1e93c7a52e099034a179d90de1c
1 <?php
2 /* Prototype : DateTime date_modify ( DateTime $object , string $modify )
3 * Description: Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().
4 * Source code: ext/date/php_date.c
5 * Alias to functions: public DateTime DateTime::modify()
6 */
8 //Set the default time zone
9 date_default_timezone_set("Europe/London");
11 echo "*** Testing date_modify() : error conditions ***\n";
13 echo "\n-- Testing date_modify() function with zero arguments --\n";
14 var_dump( date_modify() );
16 // Create a date object
17 $datetime = date_create("2009-01-30 19:34:10");
19 echo "\n-- Testing date_modify() function with less than expected no. of arguments --\n";
20 var_dump( date_modify($datetime) );
22 echo "\n-- Testing date_modify() function with more than expected no. of arguments --\n";
23 $modify = "+1 day";
24 $extra_arg = 99;
25 var_dump( date_modify($datetime, $modify, $extra_arg) );
27 echo "\n-- Testing date_modify() function with an invalid values for \$object argument --\n";
28 $invalid_obj = new stdClass();
29 var_dump( date_modify($invalid_obj, $modify) );
30 $invalid_obj = 10;
31 var_dump( date_modify($invalid_obj, $modify) );
32 $invalid_obj = null;
33 var_dump( date_modify($invalid_obj, $modify) );
36 ===DONE===