php > $x = "foo";
php > $x
php > ;
php >
php > echo $x;
foo
php >
If you do something stupid (as we all do, that's why we need an interactive shell for experimenting), it kills the program at drop you back in the terminal. You loose all your work and have to start over.
php > foo();
PHP Fatal error: Call to undefined function foo() in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
php > function f() {};
php > function f() {};
PHP Fatal error: Cannot redeclare f() (previously declared in php shell code:1) in php shell code on line 1
php > echo "hello world";
hello world
php > echo $x;
PHP Notice: Undefined variable: x in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
php > echo $x;
PHP Notice: Undefined variable: x in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
php > echo $x;
PHP Notice: Undefined variable: x in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
php > echo "hello world"
php >
php >
php >
php >
php >
php >
php > echo "what is going on?"
php >
php >
php > ;
PHP Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in php shell code on line 8
php >
And this makes you love it?