Line By Lile Compilation
Moderator: General Moderators
Line By Lile Compilation
How Can we compile line by line in php. 
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Line By Lile Compilation
You can't compile line by line as such since expressions can run over several lines, but if you're looking for a console environment you can run PHP on the command line in interactive mode. Example (using "php -a"):
Code: Select all
d11wtq@w3style.co.uk:~$ php -a
Interactive shell
php > $foo = "bar";
php > function sayTwice($term) {
php { echo str_repeat($term, 2);
php { }
php > sayTwice($foo);
barbar
php > exit();
d11wtq@w3style.co.uk:~$
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Re: Line By Lile Compilation
You could also emulate it with eval(), although I'm not sure how you'd handle multiline statements.