blob: cef6621a75d89839aa15c2f2070c718abb9ac853 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--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===
--EXPECTF--
*** Testing clone on DateTime objects ***
Original: 22:41:50
Clone: 14:25:41
===DONE===
|