3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP_VERSION_ID is available as of PHP 5.2.7, if our // version is lower than that, then emulate it if (!defined('PHP_VERSION_ID')) { $version = explode('.', PHP_VERSION); define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); } // PHP_VERSION_ID is defined as a number, where the higher the number // is, the newer a PHP version is used. It's defined as used in the above // expression: // // $version_id = $major_version * 10000 + $minor_version * 100 + $release_version; // // Now with PHP_VERSION_ID we can check for features this PHP version // may have, this doesn't require to use version_compare() everytime // you check if the current PHP version may not support a feature. // // For example, we may here define the PHP_VERSION_* constants thats // not available in versions prior to 5.2.7 if (PHP_VERSION_ID < 50207) { define('PHP_MAJOR_VERSION', $version[0]); define('PHP_MINOR_VERSION', $version[1]); define('PHP_RELEASE_VERSION', $version[2]); // and so on, ... } echo 'PHP_VERSION_ID: ' . PHP_VERSION_ID . ' '; echo 'PHP_MAJOR_VERSION: ' . PHP_MAJOR_VERSION . ' '; echo 'PHP_MINOR_VERSION: ' . PHP_MINOR_VERSION . ' '; echo 'PHP_RELEASE_VERSION: ' . PHP_RELEASE_VERSION . ' '; ?>

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).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.10.0110.00716.81
8.5.00.0150.00720.17
8.4.150.0020.00014.05
8.4.140.0090.01217.57
8.4.130.0070.00218.96
8.4.120.0130.00723.90
8.4.110.0100.00618.74
8.4.100.0040.00418.98
8.4.90.0100.00620.36
8.4.80.0110.00418.63
8.4.70.0110.00818.26
8.4.60.0040.00418.78
8.4.50.0070.00918.63
8.4.40.0190.00319.31
8.4.30.0080.01217.64
8.4.20.0140.00719.33
8.4.10.0030.00619.56
8.3.280.0110.00820.27
8.3.270.0120.01716.43
8.3.260.0110.00816.59
8.3.250.0110.00718.85
8.3.240.0110.00816.96
8.3.230.0120.00716.50
8.3.220.0060.00218.88
8.3.210.0080.01118.54
8.3.200.0060.00416.78
8.3.190.0120.00718.72
8.3.180.0130.00616.97
8.3.170.0000.00818.82
8.3.160.0160.00317.06
8.3.150.0040.00417.25
8.3.140.0000.00716.48
8.3.130.0080.00016.75
8.3.120.0100.01018.61
8.3.110.0100.00020.94
8.3.100.0070.01018.31
8.3.90.0130.00426.77
8.3.80.0040.00417.97
8.3.70.0120.00316.50
8.3.60.0140.00018.18
8.3.50.0070.00618.30
8.3.40.0060.01218.84
8.3.30.0110.00418.67
8.3.20.0040.00420.39
8.3.10.0080.00023.65
8.3.00.0020.00523.66
8.2.290.0100.00920.20
8.2.280.0040.00618.34
8.2.270.0150.00417.09
8.2.260.0040.00418.79
8.2.250.0040.00416.57
8.2.240.0040.00417.32
8.2.230.0100.00222.58
8.2.220.0050.00524.06
8.2.210.0040.00426.77
8.2.200.0040.00418.29
8.2.190.0130.00716.58
8.2.180.0070.00718.54
8.2.170.0110.00422.96
8.2.160.0030.01019.24
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0050.00226.16
8.2.120.0000.00921.14
8.2.110.0050.00519.30
8.2.100.0110.00017.91
8.2.90.0030.00617.82
8.2.80.0030.00619.70
8.2.70.0000.00817.50
8.2.60.0000.00817.80
8.2.50.0000.00718.16
8.2.40.0040.00422.31
8.2.30.0000.00718.98
8.2.20.0000.00718.04
8.2.10.0000.00717.84
8.2.00.0040.00418.01
8.1.330.0110.00821.96
8.1.320.0100.00915.89
8.1.310.0000.00816.58
8.1.300.0030.00616.00
8.1.290.0000.00930.84
8.1.280.0170.00325.92
8.1.270.0040.00422.19
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0060.00321.00
8.1.230.0030.00720.86
8.1.220.0000.01017.74
8.1.210.0030.00618.77
8.1.200.0030.00517.10
8.1.190.0000.00816.97
8.1.180.0080.00018.10
8.1.170.0060.00318.54
8.1.160.0070.00018.80
8.1.150.0000.00720.06
8.1.140.0040.00419.11
8.1.130.0000.00818.85
8.1.120.0030.00517.31
8.1.110.0000.00817.28
8.1.100.0070.00017.35
8.1.90.0030.00417.36
8.1.80.0040.00417.22
8.1.70.0030.00317.38
8.1.60.0040.00417.41
8.1.50.0040.00417.33
8.1.40.0000.00717.38
8.1.30.0050.00317.43
8.1.20.0000.00817.42
8.1.10.0040.00417.44
8.1.00.0040.00417.33
8.0.300.0000.00820.04
8.0.290.0060.00316.63
8.0.280.0000.00818.28
8.0.270.0000.00716.80
8.0.260.0000.00618.43
8.0.250.0000.00716.83
8.0.240.0080.00316.93
8.0.230.0030.00316.88
8.0.220.0000.00716.85
8.0.210.0000.00716.91
8.0.200.0030.00316.79
8.0.190.0050.00316.98
8.0.180.0070.00016.81
8.0.170.0000.00716.92
8.0.160.0040.00416.98
8.0.150.0000.00716.90
8.0.140.0040.00416.84
8.0.130.0030.00313.29
8.0.120.0040.00416.85
8.0.110.0000.00816.82
8.0.100.0000.00716.64
8.0.90.0040.00416.74
8.0.80.0070.00716.92
8.0.70.0070.00016.68
8.0.60.0040.00416.81
8.0.50.0040.00416.84
8.0.30.0090.00917.11
8.0.20.0100.00917.40
8.0.10.0000.00716.89
8.0.00.0140.00516.84
7.4.330.0050.00015.55
7.4.320.0000.00616.41
7.4.300.0000.00716.41
7.4.290.0070.00016.45
7.4.280.0050.00316.42
7.4.270.0030.00316.42
7.4.260.0000.00716.48
7.4.250.0000.00816.36
7.4.240.0040.00416.36
7.4.230.0080.00016.55
7.4.220.0070.01316.45
7.4.210.0130.00316.28
7.4.200.0000.00716.61
7.4.160.0140.00216.36
7.4.150.0060.01117.40
7.4.140.0110.01117.86
7.4.130.0180.00016.44
7.4.120.0100.00916.43
7.4.110.0130.00316.49
7.4.100.0110.01016.38
7.4.90.0100.00716.40
7.4.80.0070.01019.39
7.4.70.0100.01416.41
7.4.60.0100.00616.40
7.4.50.0080.00516.33
7.4.40.0120.00616.31
7.4.30.0120.00616.45
7.4.00.0040.00414.91
7.3.330.0050.00013.09
7.3.320.0000.00613.06
7.3.310.0030.00316.30
7.3.300.0070.00016.21
7.3.290.0080.00016.13
7.3.280.0070.01016.27
7.3.270.0090.00917.40
7.3.260.0090.00716.42
7.3.250.0100.00916.45
7.3.240.0060.01216.30
7.3.230.0100.01316.49
7.3.210.0030.01316.38
7.3.200.0080.00816.48
7.3.190.0080.00816.18
7.3.180.0030.01616.09
7.3.170.0030.01316.18
7.3.160.0120.00916.41
7.3.10.0080.00516.58
7.3.00.0110.00116.57
7.2.330.0140.00316.43
7.2.320.0100.00716.61
7.2.310.0040.02016.61
7.2.300.0100.01316.37
7.2.290.0200.00316.54
7.2.130.0060.00616.89
7.2.120.0090.00516.70
7.2.110.0020.00816.65
7.2.100.0030.01116.88
7.2.90.0080.00616.61
7.2.80.0030.01016.84
7.2.70.0050.00716.92
7.2.60.0070.00416.75
7.2.50.0040.01116.65
7.2.40.0030.01316.60
7.2.30.0040.01116.87
7.2.20.0030.01316.71
7.2.10.0030.01316.73
7.2.00.0080.00716.79
7.1.250.0070.00615.54
7.1.200.0030.00715.62
7.1.120.1350.01216.82
7.1.110.0970.01316.32
7.1.100.1090.01316.12
7.1.90.0730.01016.04
7.1.80.2250.01315.95
7.1.70.0600.00415.23
7.1.60.0810.00733.14
7.1.50.1420.01632.58
7.1.40.0750.01332.31
7.1.30.0910.01432.46
7.1.20.0680.01432.50
7.1.10.0900.01014.54
7.1.00.0450.01314.80
7.0.250.0950.01315.89
7.0.240.1140.01015.67
7.0.230.0680.01315.92
7.0.220.0740.01315.71
7.0.210.0610.01014.78
7.0.200.0950.00614.92
7.0.190.1160.00614.89
7.0.180.0900.01014.36
7.0.170.1260.01014.16
7.0.160.0750.00714.14
7.0.150.0590.01114.24
7.0.140.0480.01114.40
7.0.130.0520.00714.32
7.0.120.0580.00714.55
7.0.110.0510.01014.33
7.0.100.0710.01214.15
7.0.90.0410.01314.29
7.0.80.0480.00714.46
7.0.70.0630.01014.45
7.0.60.0550.00714.01
7.0.50.0660.00314.46
7.0.40.0550.00914.83
7.0.30.1000.01014.55
7.0.20.1050.01014.43
7.0.10.0860.00014.46
7.0.00.0720.00914.76
5.6.400.0150.00815.78
5.1.00.0080.00511.00

preferences:
35.83 ms | 403 KiB | 5 Q