3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /*************************************************************** * Copyright notice * * (c) 2007 Dmitry Dulepov <dmitry@typo3.org> * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * [CLASS/FUNCTION INDEX of SCRIPT] */ /** * Content post-processing functions. * * @author Dmitry Dulepov <dmitry@typo3.org> * @package TYPO3 * @subpackage tx_robots */ class tx_robots_postproc { /** * Checks for indexing flags * * @param array $params Unused * @param object $pObj Reference to TSFE */ function contentPostProcOutput(&$params, &$pObj) { // Only if flags are non-zero and <meta name="robots"> is not set already if ($GLOBALS['TSFE']->page['tx_robots_flags'] && false !== ($pos = stripos($pObj->content, '</head>')) && !preg_match('/<meta[^>]*\sname=([\'"])?robots\1/i', $pObj->content)) { $values = array(1 => 'index', 2 => 'follow'); if ($GLOBALS['TSFE']->page['tx_robots_flags'] & 1) { $values[1] = 'noindex'; } if ($GLOBALS['TSFE']->page['tx_robots_flags'] & 2) { $values[2] = 'nofollow'; } $pObj->content = substr($pObj->content, 0, $pos) . '<meta name="robots" content="' . implode(',', $values) . '" />' . chr(10) . substr($pObj->content, $pos); } } } if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/robots/class.tx_robots_postproc.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/robots/class.tx_robots_postproc.php']); } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.110.0180.00416.64
7.2.00.0030.00919.27
7.1.100.0080.00518.13
7.1.70.0000.00816.93
7.1.60.0120.00919.70
7.1.50.0030.02216.54
7.1.00.0070.07322.43
7.0.200.0030.00716.63
7.0.140.0070.07022.13
7.0.60.0130.08019.78
7.0.50.0070.06017.88
7.0.40.0100.04020.13
7.0.30.0230.07320.24
7.0.20.0230.08020.36
7.0.10.0300.07720.20
7.0.00.0030.04320.06
5.6.280.0100.06720.93
5.6.210.0100.07720.61
5.6.200.0030.04318.29
5.6.190.0130.08020.68
5.6.180.3270.04020.42
5.6.170.0330.08320.62
5.6.160.0100.07020.50
5.6.150.0030.07018.21
5.6.140.0070.05018.17
5.6.130.0030.08318.13
5.6.120.0000.05321.00
5.6.110.0030.04720.99
5.6.100.0130.06721.02
5.6.90.0030.04721.09
5.6.80.0000.04320.54
5.6.70.0300.05720.43
5.5.350.0200.07720.37
5.5.340.0030.04317.99
5.5.330.0030.04320.43
5.5.320.0470.07020.36
5.5.310.0430.05720.37
5.5.300.0030.08317.95
5.5.290.0100.08017.95
5.5.280.0100.03720.75
5.5.270.0130.07720.88
5.5.260.0070.08020.66
5.5.250.0070.04020.63
5.5.240.0230.06320.20
5.4.450.0800.05719.48
5.4.440.0570.04719.57
5.4.430.0630.08719.70
5.4.420.0630.00019.21
5.4.410.0100.07318.93
5.4.400.1100.05018.52
5.4.390.0830.05718.79
5.4.380.0030.06318.73
5.4.370.0130.05018.69
5.4.360.0130.04718.78
5.4.350.0100.06012.04
5.4.340.0030.03712.03
5.4.320.0090.04412.52
5.4.310.0090.05512.51
5.4.300.0100.05012.52
5.4.290.0110.06612.52
5.4.280.0090.06012.41
5.4.270.0120.05112.41
5.4.260.0110.05212.41
5.4.250.0050.06012.41
5.4.240.0080.06112.41
5.4.230.0060.07912.41
5.4.220.0170.08512.40
5.4.210.0120.05312.41
5.4.200.0070.05812.40
5.4.190.0090.05912.40
5.4.180.0130.05012.40
5.4.170.0120.05412.41
5.4.160.0150.06412.41
5.4.150.0220.09212.40
5.4.140.0110.09512.08
5.4.130.0110.05812.07
5.4.120.0070.05912.03
5.4.110.0120.05312.02
5.4.100.0180.06212.02
5.4.90.0150.05512.02
5.4.80.0080.06112.02
5.4.70.0200.08912.02
5.4.60.0210.08712.02
5.4.50.0270.08712.02
5.4.40.0200.08212.01
5.4.30.0150.05112.00
5.4.20.0150.05612.01
5.4.10.0100.05412.00
5.4.00.0110.05111.49
5.3.290.0060.04312.80
5.3.280.0120.06112.71
5.3.270.0090.05812.72
5.3.260.0070.06012.72
5.3.250.0090.05912.72
5.3.240.0120.05212.71
5.3.230.0080.05412.71
5.3.220.0080.05512.68
5.3.210.0100.05512.68
5.3.200.0110.05112.68
5.3.190.0120.05412.68
5.3.180.0110.04712.68
5.3.170.0100.07112.66
5.3.160.0080.05512.67
5.3.150.0100.06112.67
5.3.140.0090.04712.66
5.3.130.0070.05812.66
5.3.120.0060.05312.66
5.3.110.0050.06112.66
5.3.100.0130.04512.13
5.3.90.0110.04212.12
5.3.80.0120.03612.11
5.3.70.0120.03812.11
5.3.60.0100.04112.09
5.3.50.0090.04312.04
5.3.40.0070.05712.04
5.3.30.0090.04512.00
5.3.20.0070.04511.78
5.3.10.0060.04811.74
5.3.00.0070.04711.73
5.2.170.0070.0369.23
5.2.160.0140.0299.23
5.2.150.0100.0329.24
5.2.140.0080.0379.23
5.2.130.0050.0429.20
5.2.120.0100.0379.20
5.2.110.0090.0399.20
5.2.100.0070.0369.19
5.2.90.0090.0359.19
5.2.80.0090.0319.18
5.2.70.0060.0299.18
5.2.60.0030.0329.14
5.2.50.0060.0439.11
5.2.40.0050.0419.09
5.2.30.0070.0439.06
5.2.20.0050.0419.05
5.2.10.0020.0448.95
5.2.00.0050.0458.82
5.1.60.0030.0388.11
5.1.50.0070.0328.10
5.1.40.0040.0378.08
5.1.30.0070.0378.43
5.1.20.0060.0378.46
5.1.10.0050.0368.18
5.1.00.0050.0388.18
5.0.50.0030.0316.65
5.0.40.0040.0296.52
5.0.30.0060.0426.34
5.0.20.0030.0296.29
5.0.10.0070.0266.27
5.0.00.0030.0426.27
4.4.90.0050.0224.78
4.4.80.0060.0224.75
4.4.70.0060.0244.76
4.4.60.0040.0224.76
4.4.50.0100.0284.77
4.4.40.0050.0364.71
4.4.30.0060.0214.76
4.4.20.0060.0154.85
4.4.10.0020.0194.85
4.4.00.0040.0264.76
4.3.110.0020.0184.67
4.3.100.0030.0164.66
4.3.90.0020.0174.63
4.3.80.0030.0274.59
4.3.70.0060.0144.63
4.3.60.0040.0164.63
4.3.50.0080.0134.63
4.3.40.0020.0284.54
4.3.30.0030.0173.32
4.3.20.0030.0173.29
4.3.10.0020.0193.26
4.3.00.0070.0276.52