1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/Zend/tests/match/012.phpt
T
2020-07-09 23:52:17 +02:00

37 lines
520 B
PHP

--TEST--
Strict comparison in match expression
--FILE--
<?php
function wrong() {
throw new Exception();
}
var_dump(match (0) {
null => wrong(),
false => wrong(),
0.0 => wrong(),
[] => wrong(),
'' => wrong(),
0 => 'int',
});
function get_value() {
return 0;
}
var_dump(match (get_value()) {
null => wrong(),
false => wrong(),
0.0 => wrong(),
[] => wrong(),
'' => wrong(),
0 => 'int',
default => 'default',
});
?>
--EXPECT--
string(3) "int"
string(3) "int"