A playground project demonstrating modern PHP features (8.0 to 8.4) and fundamental Laravel architectural concepts.
- PHP: >= 8.5 (as per
composer.json) - Composer (for dependencies)
- Match Expressions: Cleaner alternative to switch statements.
- Named Arguments: Pass arguments by name rather than position.
- Nullsafe Operator: Safe property/method access (
?->). - Constructor Property Promotion: Boilerplate reduction for class properties.
- Union Types: Type declarations accepting multiple types.
- Intersection Types: Type declarations requiring multiple interfaces.
- Enums: Native enumerations.
- Fibers: Low-level concurrency primitives.
- Weak Map: Garbage-collection friendly object maps.
- Attributes: Native metadata for classes/methods.
- Closures: Anonymous functions.
- Lazy Initialization: Examples of lazy loading patterns.
- Laravel Facade: Simulating Laravel's Facade pattern.
- Dependency Injection: Container and injection basics.
- Routing & Middleware: Simulating Laravel's routing pipeline using closures.
- Interfaces: Contract definitions.
- Magic Methods: PHP's
__get,__set,__call, etc.
You can run any of the files directly via CLI or serve the directory using a PHP server.
php php_match_expression.phpphp -S localhost:8000Then visit http://localhost:8000 to see the index page.