oraoto / pib

PHP in Browser (powered by WebAssembly)
https://oraoto.github.io/pib/
Apache License 2.0
956 stars 112 forks source link

Providing stub STDOUT/STDERR resources #29

Open TysonAndre opened 5 years ago

TysonAndre commented 5 years ago

Is that something you'd be interested in a PR for? php embed differs from a regular CLI in that it doesn't provide these (but echo works)

I have this working in a fork - https://github.com/TysonAndre/phan-demo/blob/79d6df9950789ebf54cf3c798f772df8a76e887e/pib_eval.c#L16-L54

Alternately, a regular define+fopen in pure php before the script in question may work more reliably.

seanmorris commented 4 years ago

This looks pretty goddamn useful, I've got another branch in the works at https://github.com/seanmorris/php-wasm, its got persistent memory and a way to call out to JS!

How did you get STDERR working? Thats been driving me insane.