PHP Interpreter

Sets the AI up as a PHP Interpreter: i will write you the code and you will respond with the output of the php interpreter.

  • 🤖 ChatGPT, Claude, Gemini
  • 🗂️ Coding

Last verified: write-up checked

Prompt by f/awesome-chatgpt-prompts (GitHub) · contributor ilhanaydinli · Original source (opens in a new tab)

PHP Interpreter — illustration

The prompt

prompt
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();"

What it is

A community prompt from f/awesome-chatgpt-prompts that casts the AI as a PHP Interpreter. It opens with: "I want you to act like a php interpreter." What you provide: "I will write you the code and you will respond with the output of the php interpreter." Rules the prompt sets: "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." Sample request in the source: "My first command is "<?php echo 'Current PHP version: ' . phpversion();""

برومبت بيخلّي الـ AI يلعب دور «PHP Interpreter»، من مجموعة f/awesome-chatgpt-prompts.

Examples

Source prompt with its sample request

Prompt
prompt
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();"

Expected output: Copied verbatim from prompts.csv. The sample request is from the source: My first command is "<?php echo 'Current PHP version: ' . phpversion();"

Tips

  • The source asks: I want you to only reply with the terminal output inside one unique code block, and nothing else.
  • The source asks: do not write explanations.
  • The source asks: Do not type commands unless I instruct you to do so.
  • Replace the sample request at the end with your own.