…ead of what happens to be the next line to be read.
… is set to 2
The readline module is part of the standard Python package found in most common Linux distributions (Debian/Ubuntu/Mint/Fedora/etc.). The only major Posix distribution requiring an explicit readline installation is Mac OS X. Another notable exception is the ActivePython distribution which also ships without readline.
Mac OS X's default PHP install does not include pcntl. Let's make this optional, so people don't have to recompile PHP just to use phpsh. This commit lets us use the benefits of pcntl if we have it, but doesn't force us to have it.
In order to avoid crashing phpsh on fatal errors, a trick was added that would fork PHP on every command. This trick relies on `__init__.py` to keep track of PIDs. Unfortunately, on some systems, namely Ubuntu, `subprocess.Popen()` reports an incorrect PID for the initial startup of `phpsh.php`. The reason for this has to do with the way that `subprocess.Popen()` executes commands. By default, commands are executed using the Bourne shell (or a Bourne shell replacement which is more likely the case) by issuing the following command: `/bin/sh -c command`. The problem with this is that some Bourne shell replacements handle this differently. For example, in bash this command will create a single process with a single PID. In dash (the default Bourne shell replacement for Ubuntu) this command will create two separate processes and report back to Python that the PID is actually for the `/bin/sh -c` command. To fix this inconsistency, we must force Python to use the same shell regardless of the operating system. I've chosen bash since it's the more ubiquitous Bourne shell replacement and also produces the more desirable results.
…g build directory or compiled python files.
Ignore stderr while checking if Xdebug is already loaded.
after inserting all of them, instead of insertion sorting.