Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.15.0

* added `preg_last_error_msg()` to the PHP 8 polyfill
* added interface `Stringable` to the PHP 8 polyfill

# 1.14.0

Expand Down
3 changes: 2 additions & 1 deletion src/Php80/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Symfony Polyfill / Php80
========================

This component provides functions added to PHP 8.0 core:
This component provides features added to PHP 8.0 core:

- `Stringable` interface
- [`fdiv`](https://php.net/fdiv)
- `ValueError` class
- `FILTER_VALIDATE_BOOL` constant
Expand Down
9 changes: 9 additions & 0 deletions src/Php80/Resources/stubs/Stringable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

interface Stringable
{
/**
* @return string
*/
public function __toString();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public function __toString() : string;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing return type on purpose, see https://wiki.php.net/rfc/stringable:

code in PHP < 8 can adopt a polyfill interface immediately (one that doesn't declare the return type for the same BC reasons.)

}