You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into some bugs with getting the escaping correct when passing the data to PHP from the command line and using a temporary file made debugging a lot easier.
A bigger issue is that the idea of running PHP code from inside of a Python script is total nuts and no one should do it
I feel the temp file route just feels more like idiomatic PHP. Who actually uses the PHP REPL anyway? Is it "really" PHP without the <?php tag? A+, would ruin my life with this!
According to the man page, you only get the interactive REPL if you pass -a or --interactive. With no argument, it parses stdin just like it would parse a file.
Activity
joshmaker commentedon Apr 1, 2016
I ran into some bugs with getting the escaping correct when passing the data to PHP from the command line and using a temporary file made debugging a lot easier.
A bigger issue is that the idea of running PHP code from inside of a Python script is total nuts and no one should do it
myers404 commentedon Apr 1, 2016
I feel the temp file route just feels more like idiomatic PHP. Who actually uses the PHP REPL anyway? Is it "really" PHP without the <?php tag? A+, would ruin my life with this!
o11c commentedon Apr 1, 2016
According to the man page, you only get the interactive REPL if you pass
-aor--interactive. With no argument, it parses stdin just like it would parse a file.joshmaker commentedon Apr 2, 2016
Also command-line argument can theoretically run into max line length issues if you are trying to pass very large amounts of data to PHP.