1--TEST-- 2Test DateTimeZone class registration 3--FILE-- 4<?php 5 6echo "*** Verify DateTimeZone class ***\n"; 7 8echo "Verify DateTimeZone class registered OK\n"; 9$class = new ReflectionClass('DateTimeZone'); 10var_dump($class); 11 12echo "..and get names of all its methods\n"; 13$methods = $class->getMethods(); 14var_dump($methods); 15 16echo "..and get names of all its class constants\n"; 17$constants = $class->getConstants(); 18var_dump($constants); 19?> 20===DONE=== 21--EXPECTF-- 22*** Verify DateTimeZone class *** 23Verify DateTimeZone class registered OK 24object(ReflectionClass)#%d (1) { 25 ["name"]=> 26 string(12) "DateTimeZone" 27} 28..and get names of all its methods 29array(7) { 30 [0]=> 31 &object(ReflectionMethod)#%d (2) { 32 ["name"]=> 33 string(11) "__construct" 34 ["class"]=> 35 string(12) "DateTimeZone" 36 } 37 [1]=> 38 &object(ReflectionMethod)#%d (2) { 39 ["name"]=> 40 string(7) "getName" 41 ["class"]=> 42 string(12) "DateTimeZone" 43 } 44 [2]=> 45 &object(ReflectionMethod)#%d (2) { 46 ["name"]=> 47 string(9) "getOffset" 48 ["class"]=> 49 string(12) "DateTimeZone" 50 } 51 [3]=> 52 &object(ReflectionMethod)#%d (2) { 53 ["name"]=> 54 string(14) "getTransitions" 55 ["class"]=> 56 string(12) "DateTimeZone" 57 } 58 [4]=> 59 &object(ReflectionMethod)#%d (2) { 60 ["name"]=> 61 string(11) "getLocation" 62 ["class"]=> 63 string(12) "DateTimeZone" 64 } 65 [5]=> 66 &object(ReflectionMethod)#%d (2) { 67 ["name"]=> 68 string(17) "listAbbreviations" 69 ["class"]=> 70 string(12) "DateTimeZone" 71 } 72 [6]=> 73 &object(ReflectionMethod)#%d (2) { 74 ["name"]=> 75 string(15) "listIdentifiers" 76 ["class"]=> 77 string(12) "DateTimeZone" 78 } 79} 80..and get names of all its class constants 81array(14) { 82 ["AFRICA"]=> 83 int(1) 84 ["AMERICA"]=> 85 int(2) 86 ["ANTARCTICA"]=> 87 int(4) 88 ["ARCTIC"]=> 89 int(8) 90 ["ASIA"]=> 91 int(16) 92 ["ATLANTIC"]=> 93 int(32) 94 ["AUSTRALIA"]=> 95 int(64) 96 ["EUROPE"]=> 97 int(128) 98 ["INDIAN"]=> 99 int(256) 100 ["PACIFIC"]=> 101 int(512) 102 ["UTC"]=> 103 int(1024) 104 ["ALL"]=> 105 int(2047) 106 ["ALL_WITH_BC"]=> 107 int(4095) 108 ["PER_COUNTRY"]=> 109 int(4096) 110} 111===DONE===