Shortcut for testing PHP code

Having a python interpreter is really useful, as it allows you to quickly enter several commands and check the output; which simplifies the understanding of syntax.

However, in PHP, every time I want to try something, I have to - create a PHP script, save it, run it in my browser.

Is there a shortcut I'm missing for PHP that will make things easier?

+3
source share
3 answers

You can run php CLI interactively;)

php -a 

in interactive mode you need to enter a script with start and end tags

<?php echo 'Hello!'; ?>
+3
source
+2

phpUnit, php

+1

Source: https://habr.com/ru/post/1751518/


All Articles