?>
===DONE===
---EXPECT--
+--EXPECTF--
*** Testing new DateTime() : usage variation - unexpected values to second argument $timezone***
-- int 0 --
FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, array given
-- uppercase NULL --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- lowercase null --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- lowercase true --
FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, boolean given
FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, object given
-- undefined var --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- unset var --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- resource --
FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, resource given
bool(false)
-- uppercase NULL --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- lowercase null --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- lowercase true --
bool(false)
-- undefined var --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- unset var --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(19) "2005-07-14 22:30:41"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
-- resource --
+++ /dev/null
---TEST--
-DateInterval: Getter and setter errors
---FILE--
-<?php
-$d = DateInterval::createFromDateString("");
-$d->y = 1984;
-var_dump($d->y);
-var_dump($d->asdf, $d->y);
-?>
---EXPECTF--
-int(1984)
-
-Fatal error: main(): Unknown property (asdf) in %sdateinterval_errors.php on line 5
foreach($inputs as $key =>$value) {
echo "\n--$key--\n";
- var_dump( gmstrftime($value) );
+ var_dump( $value );
var_dump( gmstrftime($value, $timestamp) );
};
?>
===DONE===
---EXPECTF--
+--EXPECT--
*** Testing gmstrftime() : usage variation ***
--Preferred date and time representation--
-string(%d) "%s %d %s %d %d:%d:%d %s GMT"
-string(31) "Fri 08 Aug 2008 08:08:08 AM GMT"
+string(2) "%c"
+string(24) "Fri Aug 8 08:08:08 2008"
--Preferred date representation--
-string(%d) "%d/%d/%d"
+string(2) "%x"
string(10) "08/08/2008"
--Preferred time representation--
-string(%d) "%d:%d:%d %s"
-string(11) "08:08:08 AM"
+string(2) "%X"
+string(8) "08:08:08"
===DONE===
foreach($inputs as $key =>$value) {
echo "\n--$key--\n";
- var_dump( strftime($value) );
+ var_dump( $value );
var_dump( strftime($value, $timestamp) );
}
?>
===DONE===
---EXPECTF--
+--EXPECT--
*** Testing strftime() : usage variation ***
--Preferred date and time representation--
-string(%d) "%s %d %s %d %d:%d:%d %s %s"
-string(31) "Fri 08 Aug 2008 08:08:08 AM IST"
+string(2) "%c"
+string(24) "Fri Aug 8 08:08:08 2008"
--Preferred date representation--
-string(%d) "%d/%d/%d"
+string(2) "%x"
string(10) "08/08/2008"
--Preferred time representation--
-string(%d) "%d:%d:%d %s"
-string(11) "08:08:08 AM"
+string(2) "%X"
+string(8) "08:08:08"
===DONE===