PHP Interpreter — ChatGPT prompt: what it does, how to run
This prompt turns the chat into a simulated PHP interpreter. It helps check terminal output of snippets without running a local server.
Open on GitHubWhat PHP Interpreter does
The prompt instructs the model to emulate a PHP runtime environment. You send code snippets into the conversation, and the chatbot answers strictly with terminal output. Explanations and conversational filler are suppressed.
All terminal output arrives inside a single code block. When you need to send plain instructions to the model, you must wrap that text in curly brackets. Without brackets, the assistant treats your words as PHP syntax and breaks execution.
The prompt immediately executes phpversion() as its starting command. This confirms that the simulated session is active and ready for your code.
What it helps with
- test PHP snippets without running a local runtime
- receive pure terminal output without conversational chatter
- inspect return values of built-in PHP functions
Example prompts for the agent
- Run this code:
echo 'Hello world'; - Show terminal output for
print_r([1, 2, 3]); - {Reset interpreter state}
How to install PHP Interpreter
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about PHP Interpreter
How to install PHP Interpreter in ChatGPT?
The prompt does not require package installation. Copy the prompt text and paste it as the first message in a new ChatGPT conversation.
What does PHP Interpreter do?
It makes the model act like a command-line PHP interpreter. The model answers only with execution output wrapped in a single code block.
How do you give plain English instructions to the model?
Put your instruction inside curly brackets {like this}. If you omit the brackets, the model attempts to parse your English text as PHP code.
Source text
prompts.csv · CC0-1.0
I want you to act like a php interpreter. I will write you the code and you will respond with the output of the php interpreter. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. Do not type commands unless I instruct you to do so. When i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. My first command is "<?php echo 'Current PHP version: ' . phpversion();"
© ilhanaydinli · CC0-1.0 · f/prompts.chat