TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
447 B
30 lines
447 B
--TEST--
|
|
return ternary
|
|
--SKIPIF--
|
|
--FILE--
|
|
<?php
|
|
|
|
class TestReturnTernary
|
|
{
|
|
protected function isA(): bool {
|
|
return false;
|
|
}
|
|
|
|
protected function isB(): bool {
|
|
return random_int(1, 10000) % 100 < 50;
|
|
}
|
|
|
|
public function test()
|
|
{
|
|
return ($this->isA() && $this->isB()) ? 'str' : false;
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$obj = new TestReturnTernary;
|
|
var_dump($obj->test());
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|