Skip to content
PsySH on Emacs, PHP interactive shell (REPL)
Emacs Lisp
Branch: master
Clone or download
Latest commit 2125098 Jul 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Cask Bump version 0.0.5 Nov 28, 2018 Update README Jul 11, 2016
composer.json Add Cask and composer.json Feb 7, 2017



PsySH, PHP interactive shell (REPL)



A: The easy way

$ wget
$ chmod +x psysh

And copy or make symlink to your $PATH dir.

B: The other easy way

Get Composer. See

$ composer g require psy/psysh:@stable

C: Project local REPL

Set psysh-comint-buffer-process (buffer local variable).

(setq psysh-comint-buffer-process "path/to/shell.php")

shell.php is for example:

#!/usr/bin/env php
// ↓Namespace for your project
namespace Nyaan;

// load Composer autoload file
require_once __DIR__ . '/vendor/autoload.php';
// load other initialize PHP files
// require_once …

echo __NAMESPACE__ . " shell\n";

$sh = new \Psy\Shell();

// Set project namespace in REPL
if (defined('__NAMESPACE__') && __NAMESPACE__ !== '') {
    $sh->addCode(sprintf("namespace %s;", __NAMESPACE__));


// Termination message
echo "Bye.\n";

See also (Japanese)

You can’t perform that action at this time.