Question: I want to write a PHP code snippet in the question or answer. I searched that but Stack Overflow can insert only HTML, CSS, JavaScript snippet code.

How can I insert a PHP code snippet like below?

JavaScript snippet example:

```js
console.log('hello world');
```

Answer: 
Stack Overflow has no features for executing live demos of PHP code in questions.

You should format a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) as a regular code block:

```
```php
<?php
    echo "123";
?>
```

```

You might additionally link to a live demo using a third-party demo hosting service. (Google finds [PHPFiddle](http://phpfiddle.org/), I can't speak to the quality of the service).
There isn't any way to run PHP code. You have to insert an additional link in your question/answer to share your PHP code snippet with fellow members.

A PHP code snippet can be shared by using the following websites:

<http://www.writephponline.com/>

<http://phptester.net/> - [My choice]

<https://www.mycompiler.io/online-php-compiler>

<https://paiza.io/en/languages/online-php-editor>

And many more. You can also google for this using "PHP code snippets online" keywords ;)