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.
36 lines
613 B
36 lines
613 B
--TEST--
|
|
integer, boolean and double remain class names in PHP type declarations
|
|
--FILE--
|
|
<?php
|
|
declare(strict_types=1);
|
|
|
|
class integer {}
|
|
class boolean {}
|
|
class double {}
|
|
|
|
function acceptInteger(integer $value): string
|
|
{
|
|
return get_class($value);
|
|
}
|
|
|
|
function acceptBoolean(boolean $value): string
|
|
{
|
|
return get_class($value);
|
|
}
|
|
|
|
function acceptDouble(double $value): string
|
|
{
|
|
return get_class($value);
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
echo acceptInteger(new integer()), "\n";
|
|
echo acceptBoolean(new boolean()), "\n";
|
|
echo acceptDouble(new double()), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
integer
|
|
boolean
|
|
double
|
|
|