<?php
use JetBrains\PhpStorm\ArrayShape;
const FOO_SHAPE=[
'foo'=>"string",
'bar'=>Exception::class
];
#[ArrayShape(FOO_SHAPE)]
function foo():array{
}
$a=foo();
$a['bar']->getCode();
使用 array shapes
最新推荐文章于 2022-11-21 16:54:53 发布