Annotation of embedaddon/php/ext/date/tests/DateTimeZone_clone_basic3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test clone of DateTimeZOne objects
3: --FILE--
4: <?php
5: //Set the default time zone
6: date_default_timezone_set("Europe/London");
7:
8: echo "*** Testing clone on DateTime objects ***\n";
9:
10: echo "\n-- Create a DateTimeZone object --\n";
11: $d1 = new DateTimeZone("Europe/London");
12: var_dump($d1);
13: echo "\n-- Add some properties --\n";
14: $d1->property1 = 99;
15: $d1->property2 = "Hello";
16: var_dump($d1);
17: echo "\n-- clone it --\n";
18: $d1_clone = clone $d1;
19: var_dump($d1_clone);
20: echo "\n-- Add some more properties --\n";
21: $d1_clone->property3 = true;
22: $d1_clone->property4 = 10.5;
23: var_dump($d1_clone);
24: echo "\n-- clone it --\n";
25: $d2_clone = clone $d1_clone;
26: var_dump($d2_clone);
27: ?>
28: ===DONE===
29: --EXPECTF--
30: *** Testing clone on DateTime objects ***
31:
32: -- Create a DateTimeZone object --
33: object(DateTimeZone)#%d (0) {
34: }
35:
36: -- Add some properties --
37: object(DateTimeZone)#%d (2) {
38: ["property1"]=>
39: int(99)
40: ["property2"]=>
41: string(5) "Hello"
42: }
43:
44: -- clone it --
45: object(DateTimeZone)#%d (2) {
46: ["property1"]=>
47: int(99)
48: ["property2"]=>
49: string(5) "Hello"
50: }
51:
52: -- Add some more properties --
53: object(DateTimeZone)#%d (4) {
54: ["property1"]=>
55: int(99)
56: ["property2"]=>
57: string(5) "Hello"
58: ["property3"]=>
59: bool(true)
60: ["property4"]=>
61: float(10.5)
62: }
63:
64: -- clone it --
65: object(DateTimeZone)#%d (4) {
66: ["property1"]=>
67: int(99)
68: ["property2"]=>
69: string(5) "Hello"
70: ["property3"]=>
71: bool(true)
72: ["property4"]=>
73: float(10.5)
74: }
75: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>