6
How do I run php from the command line without using a script as an argument.
Example with script:
> php index.php
I already know how to execute a certain function or code like this:
> php -r "echo 12346;"
But there is some way to do this interactively (as in python, for example)?
Something similar to this example:
> php
> echo 1;
> 1
> print_r(array());
> array(){}
There is this in PHP?
In mine only it worked without the
<?php ?>
– Wallace Maxters
To work with
<?php ?>
, first you activate the interactive mode, type the<?php echo "Hello, world!"; ?>
press ENTER then CTR+Z– henriquedpereira
what’s cool about this interactive mode ? and kind of like an Xcode playground ?
– Gabriel Rodrigues