Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
346 views
in Technique[技术] by (71.8m points)

macos - php interactive shell doesn't have any output?

bash-3.2$ php -a Interactive shell

php > $a = null || "hi"
php > echo $a
php > $b = "hi"
php > echo $b

As you can see here, nothing is being echoed.
Why is that? I'm using Mac OS X lion. = (fresh install)

question from:https://stackoverflow.com/questions/7149278/php-interactive-shell-doesnt-have-any-output

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You've forgoten to put semicolons at the end of each line. Should be:

php > $a = null || "hi";
php > echo $a;
php > $b = "hi";
php > echo $b;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...