3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPのインタラクティブシェルを試す(Mac OSX Lion)

Posted at

ちょっとした関数の実験に便利なインタラクティブシェル。似たようなものとしてFacebook製のphpshがありますが、あえて、対話シェルを試そうと思います。

PHP5.4 RCをダウンロード

コンパイル&インストール

$ ./configure \
	--prefix=/Users/suin/lib/php54 \
	--with-config-file-path=/Users/suin/lib/php54 \
	--with-readline \
	--with-libedit
$ make
$ make install

シンボリックリンクはっとく

$ ln -s ~/lib/php54/bin/php ~/bin/php54

バージョン確認

$ php54 --version
PHP 5.4.0RC7 (cli) (built: Feb 17 2012 10:30:46) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

インタラクティブシェルを phpsh という名前にしておく

$ alias phpsh='php54 -a'

試す

$ phpsh
Interactive shell

php > var_dump(1);
int(1)
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?