3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Update manifest generator for Chrome * * @category [cv-pls] * @package Chrome * @author Chris Wright <info@daverandom.com> */ class ChromeUpdateManifestGenerator { /** * @var string Namespace URL for manifest XML */ private $nsUrl = 'http://www.google.com/update2/response'; /** * Generate the update manifest document * * @param string $appId * @param string $version * @param string $packageUrl * @return \DOMDocument */ public function generate($appId, $version, $packageUrl) { $document = new \DOMDocument('1.0', 'utf-8'); $document->formatOutput = true; $rootEl = $document->createElementNS($this->nsUrl, 'g:gupdate'); $rootEl->setAttribute('protocol', '2.0'); $document->appendChild($rootEl); $appEl = $document->createElementNS($this->nsUrl, 'app'); $appEl->setAttribute('appid', $appId); $rootEl->appendChild($appEl); $updateCheckEl = $document->createElementNS($this->nsUrl, 'updatecheck'); $updateCheckEl->setAttribute('codebase', $packageUrl); $updateCheckEl->setAttribute('version', $version); $appEl->appendChild($updateCheckEl); return $document; } } $obj = new ChromeUpdateManifestGenerator; echo $obj->generate('abcdef', '1.2.3.4', 'http://foo.com/')->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0" encoding="utf-8"?> <g:gupdate xmlns:g="http://www.google.com/update2/response" protocol="2.0"> <g:app appid="abcdef"> <g:updatecheck codebase="http://foo.com/" version="1.2.3.4"/> </g:app> </g:gupdate>

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