3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHTML($buffer); foreach($doc->getElementsByTagName('img') as $tag) { $src = $tag->getAttribute('src'); $tag->setAttribute('data-src', '/images/blank.gif'); $tag->setAttribute('data-original', $src); } $buffer=$dom->saveHTML();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $buffer in /in/j11kH on line 3 Deprecated: DOMDocument::loadHTML(): Passing null to parameter #1 ($source) of type string is deprecated in /in/j11kH on line 3 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/j11kH:3 Stack trace: #0 /in/j11kH(3): DOMDocument->loadHTML('') #1 {main} thrown in /in/j11kH on line 3
Process exited with code 255.

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:
40.99 ms | 401 KiB | 8 Q