1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/date/tests/DateTime_clone_basic1.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

30 lines
585 B
PHP

--TEST--
Test clone on DateTime objects
--FILE--
<?php
//Set the default time zone
date_default_timezone_set('Europe/London');
echo "*** Testing clone on DateTime objects ***\n";
// Create a DateTime object..
$orig = new DateTime('2008-07-02 14:25:41');
// ..create a clone of it ..Clone
$clone = clone $orig;
// ..and modify original
$orig->setTime(22, 41, 50);
echo "Original: " . $orig->format("H:i:s") . "\n";
echo "Clone: " . $clone->format("H:i:s") . "\n";
?>
===DONE===
--EXPECT--
*** Testing clone on DateTime objects ***
Original: 22:41:50
Clone: 14:25:41
===DONE===