A feature of PHP I use in my day to day life as developer — but that lots of PHP developers seems to ignore — is the Interactive shell of PHP:
$ php -a
Like with Python, Ruby, Perl and many others, PHP benefits also of this feature that lets you try copy/pasted code, try some functions/algorithms before integrating them directly into a code or maybe just trying to find some weird behavior of PHP itself.
Like a real shell, the PHP interactive shell comes with:
- Tab completion
- History
- Integration of all the interesting shortcuts to edit the current line (PG+Up/Down, ALT+Backspace, ALT+Left/Right, CTRL+D,...)
- etc.
Next time you will:
- Create a PHP file into your DocumentRoot
- Open it with your favorite editor
- Fire up your browser to reach your newly created file
- Show the source code of the generated page
Maybe this day will you find command line easier :)
Want to view a demo of all this ? Sure:
1 comment:
Hey Patrick,
I enjoyed this interactive demo, but maybe a little narration would have added an extra charm to it.
Anyway, I enjoyed the topic and love to read more about it.
Michelangelo "DragonBe" van Dam
Post a Comment