PHPSTORM how to receive / print the result in the IDE's terminal?

Hello, folks! I use PHPSTORM and XAMPP on Mac. Whatever code i put in whatever project and run I receive the following:

 

/Applications/XAMPP/xamppfiles/bin/php-7.1.1 /Applications/XAMPP /Users/slavchev/Library/Preferences/PhpStorm2018.2/scratches/scratch.php

Process finished with exit code 0 

 

Or exit code 1, depends of course. If I want to see the result, even "Hello World" I have to click to open the browser and there I can see my code result. Is it possible to see it inside the IDE?

EDIT: new issue. If I use readline() I can't input anything in the IDE and I get error in the terminal.

3 comments

We need a certain code sample to understand what's going on there. Here's simple code that works:

<?php

$abc = 'abc';

$cde = readline();

print $abc . $cde;

http://recordit.co/OpqW0PnW52

0

@Eugene Morozov

Just in case: try with a scratch file -- that's what OP has. As you know it may behave differently to project files.

 

P.S. Side note -- why allowing SEO Spam comments? https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000166250/comments/360000213980

0

It's the same for a scratch file: http://recordit.co/sn4NVRDbm4

why allowing SEO Spam comments?

I messed up, the Spam view didn't show me the whole comment so I figured it's legit. Deleted, thank you.

0

Please sign in to leave a comment.