3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> </body> </html>'; $doc = new DOMDocument(); $doc->loadHTML($html); $items = $doc->getElementsByTagName("meta"); if($items->length > 0){ echo $items->item(0)->getAttribute('charset'); }
Output for git.master, git.master_jit, rfc.property-hooks
UTF-8

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:
23.14 ms | 1568 KiB | 4 Q