3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCode($account, $domain, $sampleRate) { $result = '<script type="text/javascript">' . PHP_EOL . '(function (i, s, o, g, r, a, m) {' . PHP_EOL . 'i[\'GoogleAnalyticsObject\'] = r;' . PHP_EOL . 'i[r] = i[r] || function () {' . PHP_EOL . '(i[r].q = i[r].q || []).push(arguments)' . PHP_EOL . '}, i[r].l = 1 * new Date();' . PHP_EOL . 'a = s.createElement(o),' . PHP_EOL . 'm = s.getElementsByTagName(o)[0];' . PHP_EOL . 'a.async = 1;' . PHP_EOL . 'a.src = g;' . PHP_EOL . 'm.parentNode.insertBefore(a, m)' . PHP_EOL . '})(window, document, \'script\', \'//www.google-analytics.com/analytics.js\', \'ga\');' . PHP_EOL . 'ga(\'create\', \'' . $this->account . '\',' . PHP_EOL . '{' . PHP_EOL . '\'cookieDomain\': \'' . $this->domain . '\',' . PHP_EOL . '\'siteSpeedSampleRate\': \'' . $this->sampleRate .'\'' . PHP_EOL . '}' . PHP_EOL . ');' . PHP_EOL . 'ga(\'send\', \'pageview\');' . PHP_EOL . '</script>'; return $result; } echo getCode('1', 'livejasmin.com', 100);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Using $this when not in object context in /in/LinS1:16 Stack trace: #0 /in/LinS1(28): getCode('1', 'livejasmin.com', 100) #1 {main} thrown in /in/LinS1 on line 16
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:
48.89 ms | 401 KiB | 8 Q