[ Content | View menu ]


Mark Mzyk | August 26, 2008

I’ve mentioned before that I think programming languages should have a REPL (Read-Eval-Print-Loop).

Unfortunately, PHP does not have one natively.  However, I just discovered that Facebook has opened sourced a REPL for PHP – so now you can test out your PHP code without needing to write and run a script.

Working in Python, I’ve found Python’s REPL highly convenient, so I’m going to start using Facebook’s PHP REPL for when I have to work in PHP.

Ironically, Facebook’s PHP REPL is implement in Python. I can commiserate: given the choice between Python and PHP, I’d go with Python.

Filed in: Languages,Programming.


  1. Comment by David Phillips:

    I wrote another one, phpa, in PHP: http://david.acz.org/phpa/

    (actually, you could say they wrote another one, since mine was around first :)

    September 12, 2008 @ 12:13
  2. Comment by Mark:

    Thanks for the heads up David – it’s always good to see the options that are available. I’ll try to give phpa a try when I get the chance (I’ve bee coding mostly Python lately).

    September 14, 2008 @ 14:50
  3. Pingback from REPL i PHP – czyli Telnetem do rakiety :) | TeMPOraL's devBlog:

    […] phpsh to projekt Facebook’a, będący Open-Source i napisany głównie… w Pythonie. Szczegóły pod adresem: http://www.phpsh.org/ Całość wykonana jest bardzo ładnie i dobrze wykorzystuje możliwość wyświetlania w konsoli kolorowego tekstu. Po rozpakowaniu na serwerze działa po prostu ‘z marszu’  . […]

    September 15, 2009 @ 09:47
  4. Comment by micha:

    I wrote one, too. It has all the modern features: it handles all errors and exceptions without exiting, it knows how to deal with expressions vs. statements, it has command line history support, tab completion of everything, in-repl documentation viewer, colored output, and more. Also it evals your expressions in the global scope so you can use it with PHP applications that use global variables.

    September 11, 2012 @ 15:58
  5. Comment by micha:

    Sorry, the URL for my REPL is http://github.com/micha/wigwam

    September 11, 2012 @ 15:59