Some examples of what's new in PHP 8.1
- Array unpacking
- First class callables
- Never type
- Pure intersection types
- Readonly properties
- Use 'new' in constructors
-
Run the container:
$ docker-compose up -d
-
Run the script (inside the
src
directory):$ docker exec -it php81 php <script-name>.php