raigu/php80-stringable-polyfill 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

raigu/php80-stringable-polyfill

Composer 安装命令:

composer require raigu/php80-stringable-polyfill

包简介

Polyfill to backport PHP8.0 Stringable feature to lower PHP versions

README 文档

README

Latest Stable Version GitHub license

Plyfill of Stringable interface of PHP8.0 to PHP7.4+

Allows to use Stringable interface, which will be in PHP8.0, in PHP7.4+.

Motivation

Current polyfill in sympfony/polyfill did not meet my needs.

First it did not follow explicitly the same interface signature (link) as in proposal (return type missing).

Secondly I discovered from __toString documentation that it was not possible to throw an exception from within a __toString() method before PHP 7.4.0. Doing so will result in a fatal error. The symphony/polyfill does not warn about it and allows to use polyfill starting from PHP 7.0.8. This package is explicit about this restriction in composer.json thus avoiding misuse.

Install

$ composer require raigu/php80-stringable-polyfill

License

This project is licensed under the MIT license

Acknowledgments

I would like to thank Guilliam Xavier for posting alternative names to Stringable interface. Although his recommendations where not accepted Google picked up the keywords. I was solving the same problem and where checking up my name candidates when I stumbled to Guilliam's post. Instead of continuing my own now I can create future compatible solutions that are easier to justify.

统计信息

  • 总下载量: 237
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固