DEV Community

Discussion on: PHP needs its own ES6

Collapse
 
anwar_nairi profile image
Anwar

I love the idea, and I think with the EcmaScript idea we could use a meta language. See all the new coming stuff like typed properties from PHP 7.4? What if we could use them now, and downgrade gracefully to PHP versions that do not support it by targeting a version like Typescript or Babel does for Javascript?

Collapse
 
rchoffardet profile image
Robin

You might be interested in preprocess.io (@assertchris work, not mine :) )

Collapse
 
anwar_nairi profile image
Anwar

This is truly a gem! Thousands thank you!!! @Juha-Matti, if you plan on making an ES for PHP with this library, I am in too 😉

Collapse
 
hamatti profile image
Juha-Matti Santala

Oh wow, that's really nice and seems to be quite in line with my thinking. A layer of new syntax on top of old functionality.

Thread Thread
 
anwar_nairi profile image
Anwar

Could not help myself but start a research project. github.com/khalyomede/php-next. You will be able to transpile modern PHP code into valid PHP using build tools like Gulp.

Thread Thread
 
hamatti profile image
Juha-Matti Santala

This is so cool Khalyomede! I'll have to take a look and see if I could contribute also.