Home  >  Article  >  Backend Development  >  在控制台直接应用php

在控制台直接应用php

WBOY
WBOYOriginal
2016-06-13 13:20:43807browse

在控制台直接使用php

在你编译了PHP(GNU: --with-readline)或者(BSD: --with-libedit)后,你便能够通过使用PHP的-a选项进入这个控制台.

$ php -a

Interactive mode enabled

?

linux下:

php > $a = 1;

php > $b = 2;

php > echo $a + $b;

3

?

php > function foo() {

php { ? ? echo "foo

php " bar";

php { }

php > foo();

?

windows 下

$a = 1;

$b = 2;

echo $a + $b;

注:当退出的时候,执行结果

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn