|
1 | 1 | Add support for method calls on primitive types in PHP
|
2 | 2 | =====================================================
|
3 | 3 |
|
4 |
| -> **NOTE**: The master branch of this extension implements a new calling |
5 |
| -> convention using an extra parameter. For the previous `$this` based |
6 |
| -> version see the [version 0.1][version_0_1] branch. |
7 |
| -
|
8 | 4 | This extension implements the ability to register a class that handles the
|
9 | 5 | method calls to a certain primitive type (string, array, ...). As such it
|
10 | 6 | allows implementing APIs like `$str->length()`.
|
@@ -62,7 +58,8 @@ load these APIs just include the `handlers/bootstrap.php` file.
|
62 | 58 | Installation
|
63 | 59 | ------------
|
64 | 60 |
|
65 |
| -This extension supports PHP versions 5.4 to 7.2. |
| 61 | +The master branch supports PHP version 7.0 to 8.0. Use the [version 0.2][version_0_2] |
| 62 | +branch for PHP 5 support. |
66 | 63 |
|
67 | 64 | ### Unix
|
68 | 65 |
|
@@ -95,12 +92,10 @@ Limitations
|
95 | 92 |
|
96 | 93 | This extension has a number of limitations:
|
97 | 94 |
|
98 |
| - * On PHP 5 it is not possible to write `"str"->method()` or `[...]->method()` or |
99 |
| - `(...)->method()`. This is a restriction of the PHP parser that can not be changed through an |
100 |
| - extension. On PHP 7 this syntax *is* supported. |
101 | 95 | * Due to technical limitations, it is not possible to create *mutable* APIs for primitive
|
102 | 96 | types. Modifying `$self` within the methods is not possible (or rather, will have no effect,
|
103 | 97 | as you'd just be changing a copy).
|
104 | 98 |
|
105 | 99 | [windows_dlls]: http://windows.php.net/downloads/pecl/snaps/scalar_objects/20170414/
|
| 100 | + [version_0_2]: https://github.com/nikic/scalar_objects/tree/0.2 |
106 | 101 | [version_0_1]: https://github.com/nikic/scalar_objects/tree/0.1
|
0 commit comments