String Array Cast
还没有人认领这个 Issue。
评估
调研方向
该 issue 未指明文件、测试或入口点。首先追踪 PHP 如何解析 casts 以及处理数组,然后将提议的语法与所展示的 array_map 行为进行比较。当该功能的语法、语义和兼容性都已定义并由测试覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Description
Hi there!
I would like to propose the feature that would allow to cast an array of objects into an array of strings:
/** @var Uuid[] $templateIds */
$templateIdStrings = (string[])$templateIds;
Basically this is a syntax sugar to a more verbose form identical to this:
/** @var Uuid[] $templateIds */
$templateIdStrings = array_map(static fn (Uuid $value): string => (string)$value, $templateIds);
Please, let me know what you think about it.
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.2k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 103
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
php/php-src 的其他 Issue
-
Bug SAPI: cli_server Status: Verified
难度 2/5 1-3 小时 新手友好度 88/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 76/100
-
Bug Status: Needs Triage
难度 1/5 1 小时以内 新手友好度 90/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
-
Bug Category: Tests Status: Verified
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
HarbourMasters/Shipwright#7229 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 条评论 ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 76/100