Skip to content

Tempfile is unnecessary #1

Open

Description

@o11c

PHP can execute code directly from stdin, or even from a command-line argument, so the temporary file appears to be pointless.

Activity

  1. joshmaker commented on Apr 1, 2016

    @joshmaker
    Owner

    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

  2. myers404 commented on Apr 1, 2016

    @myers404

    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!

  3. o11c commented on Apr 1, 2016

    @o11c
    Author

    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.

  4. joshmaker commented on Apr 2, 2016

    @joshmaker
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions