qq邮箱的格式是什么| 胰腺低密度影什么意思| 胃胀想吐是什么原因| 肺癌靶向治疗是什么意思| triangle是什么意思| 九月底是什么星座| 阴茎出血是什么原因| 女生安全期是什么时候| 12月7号什么星座| 减肥适合吃什么| 座驾是什么意思| 胆汁反流吃什么食物好| 强直性脊柱炎有什么症状| 三伏天什么意思| 龙涎香是什么味道| hpv阳性是什么病| 肝郁脾虚吃什么药效果最好| 吃什么尿酸降得快| 人的本质属性是什么| 表姐的女儿叫什么| 布洛芬是什么药| 节点是什么| 天相是什么意思| 三公是什么意思| 蛲虫吃什么药| 1年是什么朝代| 指尖发麻是什么原因| 什么是粉尘螨过敏| 梦见火灾预示什么| 经常说梦话是什么原因| 扁桃体结石有什么症状| 脑震荡有什么症状| 舌苔发黑是什么病的前兆| 红薯叶不能和什么一起吃| 咽喉炎吃什么| 拍手腕中间有什么好处| 盆腔彩超检查什么| 早餐吃什么最有营养又减肥| 颠茄片是什么药| 操逼什么意思| 为什么男怕招风耳| 父亲节做什么手工| 右耳烫代表什么预兆| 放疗有什么危害| 贝珠是什么| 连襟是什么意思| 杨五行属什么| 猪油不凝固是什么原因| 吃什么水果降火| 浑身发热是什么原因| 什么是hpv感染| 小孩睡觉出汗是什么原因| 吃牛肉对身体有什么好处| 珐琅手镯是什么材质| 懈怠是什么意思| 人妖是什么| 大林木命忌讳什么颜色| 火车和高铁有什么区别| 去医院打耳洞挂什么科| 什么的角| 白条是什么| AC是胎儿的什么意思| 产检是什么意思| 重丧是什么意思| 满月是什么意思| 香松是什么| 宫颈息肉吃什么药能消| 酸枣仁有什么功效| 白兰地是什么酒| 芥蒂是什么意思| 脑梗输液用什么药| 有容乃大是什么意思| 胎梦梦见蛇是什么意思| 女人眉尾有痣代表什么| 奕字五行属什么| 石斛能治什么病| 四季平安是什么生肖| 女生下面是什么味道| 前列腺钙化灶是什么病| 黄疸是什么样子的图片| lotus是什么意思| 长绒棉是什么面料| 念珠菌感染用什么药效果好| 脂肪肝是什么原因造成的| 1866年属什么生肖| 胆囊炎要注意些什么| 永加日念什么| 舌头发麻是什么病兆| 残留是什么意思| 慢性萎缩性胃炎c2是什么意思| 女同是什么意思| 对口高考班是什么意思| 梦见大水是什么预兆| 单侧耳鸣是什么原因引起的| 武则天叫什么| 脾虚吃什么食物补最快| 烂苹果气味的是什么病| 豆角和什么不能一起吃| 附睾炎吃什么药| 再创佳绩是什么意思| 人发胖的原因是什么引起的| 肌肉痛是什么原因| 刘邦属什么生肖| 10月25号是什么星座| cosplay什么意思| 负压引流器有什么作用| 睡莲和碗莲有什么区别| 青梅竹马什么意思| 什么弟什么兄| 心脏早搏挂什么科| 阴囊瘙痒是什么原因| 分别心是什么意思| 理疗是什么意思| 硬化是什么意思| 阳刚之气是什么意思| 牙疳是什么意思| 梦见自己家被盗有什么预兆| 青春痘用什么药膏擦最好呢| 什么是幼小衔接| 血压下午高是什么原因| 下眼皮肿是什么原因| 唐氏筛查和无创有什么区别| 核医学科是检查什么的| 冒冷汗是什么原因| 霸气是什么意思| 容易紧张是什么原因| 微波炉不能用什么容器| 佛家思想的核心是什么| 流鼻涕咳嗽吃什么药| 五常指的是什么| 肩周炎口服什么药最好| 酒后打嗝是什么原因| 孟姜女姓什么| 下巴长痘是为什么| 白喉采取什么隔离| 恋童癖是什么意思| 安宫牛黄丸什么时候吃最好| 舅子是什么意思| 胃发炎吃什么药好得快| 脚气挂什么科室| 水宝宝是什么| 苹果醋有什么功效| 女性漏尿是什么原因| 老人家脚肿是什么原因引起的| 连续放屁是什么原因呢| 什么是哺乳动物| xyz是什么意思| 小日子是什么意思| 一什么马车| 西红柿和番茄有什么区别| 阿姨的老公叫什么| 千里马比喻什么样的人| 海绵是什么材料做的| 葡萄糖是什么糖| 男生下面叫什么| 冷暖自知的前一句是什么| 病毒性感冒咳嗽吃什么药效果好| 姨妈期能吃什么水果| 左右逢源是什么生肖| 去心火喝什么茶好| 桑葚有什么作用| 尿道口痛什么原因| 黄金茶属于什么茶| 二月二十一是什么星座| 天可以加什么偏旁| 肩膀疼是什么原因| 七月二十九是什么星座| 变异性哮喘咳嗽吃什么药| 痛苦的反义词是什么| 化气行水是什么意思| 异什么同什么| 夏天白鸽煲什么汤最好| 抻是什么意思| s倾向是什么意思| 品牌logo是什么意思| 在农村做什么生意好| 打完狂犬疫苗有什么不良反应| 早上四五点是什么时辰| 毛肚是什么动物身上的| 纠葛是什么意思| 月经期间吃什么补气血| 验血肝功能看什么指标| 痛风吃什么药效果最好| 过敏什么症状| 幽门螺旋杆菌什么意思| 右眼跳是什么意思| 从政是什么意思| 相伴是什么意思| 梦见自己死了预示什么| 我国的国花是什么花| 不孕不育做什么检查| 做什么运动可以瘦腿| 扶摇是什么意思| 陌上花开可缓缓归矣什么意思| 高碎是什么茶| 草是什么植物| dic是什么病| 政治家是什么意思| 乙肝通过什么传染| 2010属什么生肖| 吃什么增强抵抗力| 什么级别| 孩子发烧手脚冰凉是什么原因| 两极分化是什么意思| 鹿参膏有什么作用和功效| 牙疼可以吃什么药| 业力是什么意思| 为什么阴道会放气| 拔完火罐要注意什么| 鼻腔有臭味是什么原因| 金主是什么意思| blazer是什么意思啊| 梦见移坟墓是什么预兆| 处女座和什么星座最配| 脾胃气虚吃什么中成药| 吃桑葚对身体有什么好处| 床塌了有什么预兆| 癫痫是什么原因引起的| 梦见房屋倒塌是什么征兆| 95年的猪是什么命| 粤语什么怎么说| 大便绿色的是什么原因| 手心长痣代表什么| 什么是穿刺手术| 黄芪和什么搭配最好| 印第安人属于什么人种| 粒字五行属什么| 尿酸高不能吃什么蔬菜| 腰椎间盘突出是什么原因引起的| 计算机二级什么时候查成绩| 为什么下雨后会出现彩虹| 临床医学是干什么的| 自欺欺人什么意思| 垂的第三笔是什么| 老年人脚肿什么原因| 肩袖损伤吃什么药| 射精无力吃什么药| 花木兰是什么剧种| 菌群异常是什么意思| 89年属什么生肖| 清分日期是什么意思| 漫谈是什么意思| 摩羯前面是什么星座| 蟑螂的天敌是什么| 摩卡棕是什么颜色| 布洛芬缓释胶囊有什么副作用| 客家人是什么意思| 三顾茅庐的顾是什么意思| loves是什么意思| 温州什么最出名| 信球什么意思| 治疗晕病有什么好方法| 国资委什么级别| 努尔哈赤姓什么| trust什么意思| 直肠炎是什么原因引起的| 积聚病什么意思| 奚字五行属什么| 养殖业什么最赚钱| 看见喜鹊有什么预兆| jj是什么意思| 梦见掰玉米是什么意思| 绿茶有什么功效| 抗核抗体阳性说明什么| 百度
rfc:stringable

库里左手变向虚晃戏耍尼尔森上篮2+1(掘金vs勇士)

Introduction

百度 要知道我并非一个没见过世面的人,胃早就没那么浅了,再肉麻一点,我也接得住。

This RFC introduces a new Stringable interface that is automatically added to classes that implement the __toString() method.

It has two goals:

  1. allow using string|Stringable to express string|object-with-__toString()
  2. provide a forward upgrade path from PHP 7 to 8

Proposal

Goal 1. is to allow using the string|Stringable union type in PHP 8, to accept both strings and objects that implement __toString(). This is critically missing currently, on codes that deal with stringable objects: they can't be made type-safe.

Classes that implement __toString() can also declare the interface explicitly. Classes that don't declare the interface explicitly will still declare it implicitly. This allows both forward compatibility and backward compatibility: using a polyfill, classes can declare the interface on PHP 7; and on PHP 8, classes that don't do so will still be compatible with the string|Stringable union type.

Once a polyfill becomes widely available (e.g. as part of symfony/polyfill-php80), code style checkers could be able to enforce declaring the interface when __toString() is declared explicitly, for people that prefer doing so.

Here is the stub declaration of the interface:

interface Stringable
{
   public function __toString(): string;
}

Because it adds the string return type, this interface has the potential to force a BC break on any existing libraries that want to adopt it.

In order to ease forward and backward compatibility, this RFC also proposes to automatically add the return type at compile time when a __toString() method doesn't do it explicitly already. Returning a string is already enforced by the engine so this doesn't change any semantics.

This way, code moving to PHP8 won't be forced to add the return type explicitly (which would break BC on their side), and code in PHP < 8 can adopt a polyfill interface immediately (one that doesn't declare the return type for the same BC reasons.)

Providing an easy forward-path is the second goal of this RFC.

For reference, here are some annotations in Symfony, added by contributions from real-world use cases and that currently cannot be expressed precisely enough using any union types in PHP 8.

Backward Incompatible Changes

Codes that declare a symbol named Stringable in the root namespace will have to rename it.

Proposed PHP Version(s)

PHP 8.0

RFC Impact

To Existing Extensions

Extensions will need to declare both the interface and the string return type when they declare __toString() methods if they want to pass the string|Stringable union type.

Open Issues

none

Unaffected PHP Functionality

Declaring this interface is not mandatory to benefit from the magic of the __toString() method.

Future Scope

void

Proposed Voting Choices

yes/no

Vote

Adopt the Stringable interface as proposed in this RFC?
Real name Yes No
alcaeus (alcaeus)  
alec (alec)  
asgrim (asgrim)  
ashnazg (ashnazg)  
beberlei (beberlei)  
bwoebi (bwoebi)  
carusogabriel (carusogabriel)  
colinodell (colinodell)  
derick (derick)  
dm (dm)  
dmitry (dmitry)  
duncan3dc (duncan3dc)  
galvao (galvao)  
geekcom (geekcom)  
girgias (girgias)  
heiglandreas (heiglandreas)  
jhdxr (jhdxr)  
jpauli (jpauli)  
kalle (kalle)  
kocsismate (kocsismate)  
mariano (mariano)  
mbeccati (mbeccati)  
nicolasgrekas (nicolasgrekas)  
ocramius (ocramius)  
patrickallaert (patrickallaert)  
peehaa (peehaa)  
ramsey (ramsey)  
rasmus (rasmus)  
reywob (reywob)  
ruudboon (ruudboon)  
sorin (sorin)  
stas (stas)  
svpernova09 (svpernova09)  
tandre (tandre)  
weierophinney (weierophinney)  
wyrihaximus (wyrihaximus)  
yunosh (yunosh)  
zimt (zimt)  
Final result: 29 9
This poll has been closed.

Patches and Tests

Implementation

After the project is implemented, this section should contain

  1. the version(s) it was merged into
  2. a link to the git commit(s)
  3. a link to the PHP manual entry for the feature
  4. a link to the language specification section (if any)

References

Rejected Features

  1. Adding a new stringable special type (like iterable, callable, etc.) is not considered in this RFC because it would require adding a new reserved keyword in the language. This would break BC more heavily and would defeat goal #2 mentioned previously (ability to polyfill on PHP7.)
  2. Consistently, this RFC doesn't embed any is_stringable() function. If we were to consider one, defining what happens when e.g. an int is passed has no simple answers.
  3. it has been proposed on the GitHub PR that the method attached to the interface could be named toString() instead of __toString(). This idea goes further than strictly required to achieve goal #1 and has been objected as not necessary in the following comments. For reference, here is a naive implementation of the proposal. What the patch highlights is that this increases the complexity of the engine, for a reason that would need to be justified.
rfc/stringable.txt · Last modified: by 127.0.0.1

?
望而生畏什么意思 肠易激综合症吃什么药 有什么好看的动漫 什么水果补钾 青岛是鲁什么
5月21日是什么星座 梦到门牙掉了是什么意思 什么是处女膜 什么蛇不咬人 探花是什么意思
轻奢什么意思 海参不能和什么一起吃 女人肾虚吃什么补回来 不拉屎是什么原因 舌苔厚白中间有裂纹吃什么药
什么叫统招 夏天梦见下雪是什么意思 渣是什么意思 白细胞少会引起什么病 10月份什么星座
公安和警察有什么区别hebeidezhi.com 菜园中有什么生肖hcv8jop3ns8r.cn babycare是什么牌子hcv8jop7ns2r.cn 浑身没劲是什么原因hcv9jop3ns1r.cn 门静脉增宽是什么意思onlinewuye.com
乙肝小三阳是什么意思hcv8jop8ns6r.cn 甲午五行属什么hcv8jop1ns6r.cn 撩 是什么意思hanqikai.com 山竹有什么好处hcv8jop2ns3r.cn 眼睛有眼屎用什么眼药水ff14chat.com
高血压饮食上注意什么hcv7jop9ns8r.cn 什么食物可以降血糖sscsqa.com 脂肪瘤是什么hcv9jop1ns6r.cn 手麻吃什么药hcv8jop9ns3r.cn 什么是同源染色体hcv7jop5ns0r.cn
游泳前一定要做好什么运动hcv8jop2ns7r.cn 耳鸣用什么药hcv8jop6ns1r.cn 奉天为什么改名沈阳hcv8jop2ns1r.cn 什么是天赋hcv7jop5ns0r.cn 什么叫乳糖不耐受hcv9jop6ns3r.cn
百度