endel / js2php

JavaScript (ES6) to PHP source-to-source transpiler.
https://endel.github.io/js2php/
MIT License
333 stars 41 forks source link

Please add support for ES6 Immediately-invoked function #22

Closed lawlietmester closed 6 years ago

lawlietmester commented 7 years ago

Please add support for ES6 Immediately-invoked function:

( () => {
  // some code here
})();
2pha commented 6 years ago

How would that work? PHP does not have IIFE

lawlietmester commented 6 years ago

call_user_func( function(){

});

endel commented 6 years ago

Hi @lawlietmester, sorry the delay to answer. For some reason, I wasn't receiving email updates about this repository.

Version 0.1.3 now supports IIFE's as you suggested.

Check the fixture: