Danack / PHP-to-Javascript

A tool for converting simple PHP objects/code to Javascript, so that code for manipulating objects can be used both server-side and client-side.
Other
104 stars 32 forks source link

php version <5.4.0 #21

Closed ghost closed 11 years ago

ghost commented 11 years ago

you use Traits wich is not suported on older php version than 5.4.0

problem is in file PHPToJavascript.php on line 38X. when i comented it all its work, only test NameSpace.js and TraitExample.js is not working. in NameSpace.js its correct is not working. but TraitExample.js is parsed bad.

 trait JSONFactory{
     function factory (jsonString){
         var data = json_decode(jsonString);
 .......

keywods trait is in javascript

ghost commented 11 years ago

dont use creating array via "$arr = []". its not suported in php5.3

Danack commented 11 years ago

I've been thinking about this and the answer is no.

There will never be a time where everyone upgrades at once from 5.3 to 5.4, so forcing myself to use an outdated version of PHP until 'the time is right to upgrade' would mean that I would always be stuck on PHP 5.3

ghost commented 11 years ago

Im usse php 5.3. I use it in my work. We have on server this version. We hawe there big system, so we cant update it easy. I compile php to js on it, because i modife converter on fly, and second worker use it too, so must be there and not on local php.