GitHub - preprocess/plus: ➕ A superset of PHP that makes PHP cool again.
source link: https://github.com/preprocess/plus
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
readme.md
For full documentation, visit php-plus.com.
Plus is a runtime compiler that adds features to PHP - It's also a package that you can require using composer, and is mainly used to add features and syntactic sugar to existing PHP code. Of course, those features arrive in PHP using runtime source code transformations. It was created by, and currently maintained by Nuno Maduro, and Christopher Pitt. Art work is provided by Caneco.
Enjoy a simple and powerful syntax that enables developers to build very complex applications far more quickly than before. Short closures, types, enumerations are just a few examples of what you get using Plus.
Try Plus in 10 seconds
Note: Plus is still work in progress and it's not out yet.
- First, install:
composer require pre/plus
- Then, in your editor, add the following declare:
<?php declare(plus=1); class User { // A readonly property cannot be assigned after the constructor exits public readonly string $name; // No need for the `t_function` keyword public __construct(string $name) { $this->name = $name; } // One expression functions with return statement public getUppercasedName(): string => strtoupper($this->name); }
Plus is open-sourced software licensed under the MIT license.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK