uniter
uniter copied to clipboard
🎉 PHP in the browser and Node.js => Docs: https://phptojs.com/
This is partially a note to myself. ``` php
Actually, this is not quite right. Each JavaScript object has a `.toString()` method. ``` > typeof Object.toString 'function' > typeof Number.toString 'function' > typeof "abc".toString 'function' > typeof (1).toString 'function'...
Logo?
Is there a logo? Can I get someone to make one and you choose/own it etc? I've got some designers doing other bits too, it'll probably only take an hour...
Could something like this be possible? echo "This is a PHP statement" ; Cheers
Is it Unit-er or Unite-r?
``` var php = require('uniter').createEngine('PHP'); php.getStdout().on('data', function (text) { console.log(text); }); php.getStderr().on('data', function (text) { console.error(text); }); php.execute('
So for time, i really wanted to just try out functions. To do so, I did something like ``` nano file.php uniter2js file.php > file.php.js node -p "require('./file.php.js')().execute()" ``` but,...
`include_once` is resolved as a regular function. ``` [email protected] /tmp $ nano test.php [email protected] /tmp $ cat test.php
PHP usually provides extensions; like pcntl, hprose, sockets and alike. In order to reproduce these within Uniter, this is what I would suggest: ``` javascript var Extension = require("uniter-extension"); var...
Within my last test cases, I used this line: ``` echo "PHP_EOL: [".(PHP_EOL == "\n" ? "Yes" : "No")."]"; ``` ... but actually, it would print ``` PHP_EOL: [] ```...