3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'assert(class_exists(\'\\DOMDocument\'));$doc = new DOMDocument();$doc->loadHtml(\'<html><head><meta charset="UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body id="app">Hello</body></html>\');assert($doc->getElementById(\'app\')->nodeValue === \'Hello\');'; var_dump($test); var_dump(escapeshellarg($test)); var_dump(escapeshellcmd($test)); var_dump(str_replace(['"', '$'], ['\"', '\$'], $test));
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
string(282) "assert(class_exists('\DOMDocument'));$doc = new DOMDocument();$doc->loadHtml('<html><head><meta charset="UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body id="app">Hello</body></html>');assert($doc->getElementById('app')->nodeValue === 'Hello');" string(308) "'assert(class_exists('\''\DOMDocument'\''));$doc = new DOMDocument();$doc->loadHtml('\''<html><head><meta charset="UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body id="app">Hello</body></html>'\'');assert($doc->getElementById('\''app'\'')->nodeValue === '\''Hello'\'');'" string(330) "assert\(class_exists\('\\DOMDocument'\)\)\;\$doc = new DOMDocument\(\)\;\$doc-\>loadHtml\('\<html\>\<head\>\<meta charset=\"UTF-8\"\>\<meta http-equiv=\"Content-Type\" content=\"text/html\; charset=UTF-8\"\>\</head\>\<body id=\"app\"\>Hello\</body\>\</html\>'\)\;assert\(\$doc-\>getElementById\('app'\)-\>nodeValue === 'Hello'\)\;" string(293) "assert(class_exists('\DOMDocument'));\$doc = new DOMDocument();\$doc->loadHtml('<html><head><meta charset=\"UTF-8\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body id=\"app\">Hello</body></html>');assert(\$doc->getElementById('app')->nodeValue === 'Hello');"

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:
30.58 ms | 483 KiB | 5 Q