@ 2014-04-05T16:46:35Z <?php
$dtP = new DateTimeZone('Europe/Prague');
$dtG = new DateTimeZone('GMT');
$dtG2 = new DateTimeZone('GMT');
$dtU = new DateTimeZone('UTC');
var_dump(array(
'dtP' => $dtP,
'dtG' => $dtG,
'dtG2' => $dtG2,
'dtU' => $dtU,
'$dtP == $dtG' => $dtP == $dtG,
'$dtP === $dtG' => $dtP === $dtG,
'$dtG == $dtG2' => $dtG == $dtG2,
'$dtG === $dtG2' => $dtG === $dtG2,
'$dtG == $dtU' => $dtG == $dtU,
'$dtG === $dtU' => $dtG === $dtU,
));
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.3.0 - 8.3.6 Fatal error: Uncaught DateException: Cannot compare two different kinds of DateTimeZone objects in /in/jGCHF:11
Stack trace:
#0 {main}
thrown in /in/jGCHF on line 11
Process exited with code 255 . Output for 7.4.5 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 Warning: main(): Trying to compare different kinds of DateTimeZone objects in /in/jGCHF on line 11
Warning: main(): Trying to compare different kinds of DateTimeZone objects in /in/jGCHF on line 15
array(10) {
["dtP"]=>
object(DateTimeZone)#1 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
["dtG"]=>
object(DateTimeZone)#2 (2) {
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["dtG2"]=>
object(DateTimeZone)#3 (2) {
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["dtU"]=>
object(DateTimeZone)#4 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["$dtP == $dtG"]=>
bool(false)
["$dtP === $dtG"]=>
bool(false)
["$dtG == $dtG2"]=>
bool(true)
["$dtG === $dtG2"]=>
bool(false)
["$dtG == $dtU"]=>
bool(false)
["$dtG === $dtU"]=>
bool(false)
}
Output for 5.5.10 - 5.5.38 , 5.6.0 - 5.6.28 , 7.0.0 - 7.0.20 , 7.1.0 - 7.1.10 , 7.2.0 - 7.2.33 , 7.3.12 - 7.3.33 , 7.4.0 - 7.4.4 array(10) {
["dtP"]=>
object(DateTimeZone)#1 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
["dtG"]=>
object(DateTimeZone)#2 (2) {
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["dtG2"]=>
object(DateTimeZone)#3 (2) {
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["dtU"]=>
object(DateTimeZone)#4 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["$dtP == $dtG"]=>
bool(true)
["$dtP === $dtG"]=>
bool(false)
["$dtG == $dtG2"]=>
bool(true)
["$dtG === $dtG2"]=>
bool(false)
["$dtG == $dtU"]=>
bool(true)
["$dtG === $dtU"]=>
bool(false)
}
Output for 5.5.0 - 5.5.9 array(10) {
["dtP"]=>
object(DateTimeZone)#1 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Prague"
}
["dtG"]=>
object(DateTimeZone)#2 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["dtG2"]=>
object(DateTimeZone)#3 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["dtU"]=>
object(DateTimeZone)#4 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["$dtP == $dtG"]=>
bool(true)
["$dtP === $dtG"]=>
bool(false)
["$dtG == $dtG2"]=>
bool(true)
["$dtG === $dtG2"]=>
bool(false)
["$dtG == $dtU"]=>
bool(true)
["$dtG === $dtU"]=>
bool(false)
}
Output for 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 array(10) {
["dtP"]=>
object(DateTimeZone)#1 (0) {
}
["dtG"]=>
object(DateTimeZone)#2 (0) {
}
["dtG2"]=>
object(DateTimeZone)#3 (0) {
}
["dtU"]=>
object(DateTimeZone)#4 (0) {
}
["$dtP == $dtG"]=>
bool(true)
["$dtP === $dtG"]=>
bool(false)
["$dtG == $dtG2"]=>
bool(true)
["$dtG === $dtG2"]=>
bool(false)
["$dtG == $dtU"]=>
bool(true)
["$dtG === $dtU"]=>
bool(false)
}
Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 Fatal error: Class 'DateTimeZone' not found in /in/jGCHF on line 2
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.9 Fatal error: Cannot instantiate non-existent class: datetimezone in /in/jGCHF on line 2
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Cannot instantiate non-existent class: datetimezone in /in/jGCHF on line 2
preferences:dark mode live preview
282.95 ms | 401 KiB | 354 Q