How to use the PHP interactive shell

后端 未结 4 1219
旧巷少年郎
旧巷少年郎 2020-12-31 06:05

I\'m using Ubuntu 12.04 64 bit and I want to use the PHP interactive shell:

php -a

But it doesn\'t seem to work very well, a lot of syntax

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 06:45

    How about PsySH ?

    A litle example :

    psysh 
    Psy Shell v0.7.2 (PHP 5.5.12-2ubuntu4.6 — cli) by Justin Hileman
    >>> $toto='ejgf5d78gfmkzl'
    => "ejgf5d78gfmkzl"
    >>> substr($toto,0,2)
    => "ej"
    

提交回复
热议问题