3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Renderer { function render(array $_data) { // normally you'd have some file you'd render from... extract($_data, EXTR_SKIP); return <<<LIST {$foo}\n {$bar}\n {$baz}\n LIST; } private function escapeData(array $data) { $safe = []; foreach ($data as $var => $value) { if (is_array($value)) { $safe[$key] = $this->escapeData($value); } else { $safe[$key] = htmlspecialchars($value); } } return $safe; } } $renderer = new Renderer(); $unsafe = ['<script>alert("xss");</script>', '<b>something</b>', '<i>foo</i>']; echo $renderer->render($unsafe);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $foo in /in/bXjWv on line 9 Warning: Undefined variable $bar in /in/bXjWv on line 10 Warning: Undefined variable $baz in /in/bXjWv on line 11

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.61 ms | 401 KiB | 8 Q