2014-02-27 16:20:14 -03:00
|
|
|
# php
|
|
|
|
|
2016-11-05 18:55:29 +00:00
|
|
|
> PHP command line interface.
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Parse and execute a file:
|
2014-02-27 16:20:14 -03:00
|
|
|
|
|
|
|
`php {{file}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Check syntax (lint):
|
2014-02-27 16:30:03 -03:00
|
|
|
|
|
|
|
`php -l {{file}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Run PHP interactively:
|
2014-02-27 16:20:14 -03:00
|
|
|
|
|
|
|
`php -a`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Run PHP code. Notes: a) Don't use <? ?> tags; b) Escape double quotes with backslash:
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2015-10-28 14:03:06 +05:30
|
|
|
`php -r "{{code}}"`
|
2015-12-28 14:30:32 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Start a PHP built-in web server in the current directory:
|
2015-12-28 14:30:32 +01:00
|
|
|
|
|
|
|
`php -S {{host:port}}`
|