php-next
Write modern PHP code.
Write modern PHP
array_filter($posts, $post => $post->published);
And transpile it
array_filter($posts, function($post) { return $post->published;});
Summary
Installation
npm install --save-dev php-next@0.*
or
yarn add --dev php-next@0.*
Examples
Example 1: basic usage
const phpNext = ;const arrowFunction = ; const transpiled = ;
Features list
If you want your feature to be listed here, please propose a Pull Request and update this file.
Create features
Features are functions that returns a string, transpiling the code given in first parameter.
You can inspire from the use-from
feature source code:
lib/feature/use-from.js (simplified)
const useFrom = { return code;}; moduleexports = useFrom;