3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TimeWrapper { private static $now_time = 0; /** * @param bool $force_refresh 是否强制刷新 * @return int */ public static function getTime($force_refresh = false) { if ($force_refresh) { self::$now_time = time(); } else { if (!self::$now_time) { self::$now_time = time(); } } return self::$now_time; } } // Dont' abuse 3v4l $n = 5000; $start = microtime(true); for ($i = 0; $i < $n; $i++) { $t = TimeWrapper::getTime(); } $finish = microtime(true); echo "TimeWrapper: " . ($finish - $start) . PHP_EOL; $start = microtime(true); for ($i = 0; $i < $n; $i++) { $t = time(); } $finish = microtime(true); echo "time: " . ($finish - $start) . PHP_EOL;

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)
7.4.00.0140.00414.83
7.3.120.0090.01214.74
7.3.110.0080.01114.68
7.3.100.0090.01014.79
7.3.90.0080.01314.88
7.3.80.0100.01014.92
7.3.70.0150.00514.59
7.3.60.0110.00914.79
7.3.50.0110.00814.72
7.3.40.0100.00914.69
7.3.30.0110.00814.69
7.3.20.0120.00914.72
7.3.10.0110.01114.88
7.3.00.0280.00914.83
7.2.250.0090.01515.29
7.2.240.0070.01314.94
7.2.230.0090.01215.04
7.2.220.0140.00814.97
7.2.210.0130.00814.95
7.2.200.0100.01115.04
7.2.190.0090.01214.82
7.2.180.0110.01015.03
7.2.170.0120.00914.97
7.2.160.0080.01314.96
7.2.150.0240.00715.11
7.2.140.0110.00915.15
7.2.130.0130.00715.02
7.2.120.0160.00815.10
7.2.110.0100.01115.03
7.2.100.0070.01215.18
7.2.90.0110.01015.09
7.2.80.0100.01215.04
7.2.70.0100.01215.17
7.2.60.0110.00915.03
7.2.50.0060.01215.02
7.2.40.0120.00815.00
7.2.30.0100.01215.09
7.2.20.0090.01115.15
7.2.10.0070.01315.19
7.2.00.0160.00914.96
7.1.330.0110.00813.93
7.1.320.0090.01313.81
7.1.310.0070.01313.97
7.1.300.0110.00813.71
7.1.290.0080.01214.01
7.1.280.0120.00813.85
7.1.270.0090.01014.05
7.1.260.0120.00613.97
7.1.250.0100.01013.92
7.1.240.0120.00913.85
7.1.230.0060.01413.86
7.1.220.0160.00813.93
7.1.210.0140.00813.79
7.1.200.0140.00813.88
7.1.190.0210.00213.73
7.1.180.0080.01213.90
7.1.170.0090.01213.84
7.1.160.0040.01413.81
7.1.150.0100.01013.80
7.1.140.0150.00313.93
7.1.130.0120.01313.90
7.1.120.0170.00713.71
7.1.110.0090.01213.81
7.1.100.0100.01213.84
7.1.90.0130.00913.73
7.1.80.0160.00413.78
7.1.70.0240.00813.81
7.1.60.0110.00713.81
7.1.50.0130.00413.80
7.1.40.0090.00913.87
7.1.30.0060.01413.68
7.1.20.0060.01213.78
7.1.10.0130.00513.91
7.1.00.0070.01213.91
7.0.330.0180.00813.40
7.0.320.0090.00713.56
7.0.310.0110.00713.46
7.0.300.0120.01113.38
7.0.290.0110.00913.53
7.0.280.0070.01313.53
7.0.270.0120.00813.46
7.0.260.0130.01013.56
7.0.250.0120.01113.59
7.0.240.0080.01213.46
7.0.230.0110.00713.61
7.0.220.0150.00513.56
7.0.210.0070.01013.52
7.0.200.0120.00513.42
7.0.190.0080.01013.51
7.0.180.0100.00913.45
7.0.170.0120.00713.55
7.0.160.0040.01613.60
7.0.150.0110.00813.29
7.0.140.0100.01013.31
7.0.130.0130.00813.23
7.0.120.0300.01013.56
7.0.110.0090.01013.53
7.0.100.0080.00913.55
7.0.90.0090.01013.40
7.0.80.0120.00913.45
7.0.70.0100.00813.47
7.0.60.0170.00413.44
7.0.50.0140.00713.39
7.0.40.0070.01613.68
7.0.30.0150.00313.67
7.0.20.0080.01313.53
7.0.10.0100.01113.47
7.0.00.0110.01313.65
5.6.400.0130.00714.54
5.6.390.0120.01114.02
5.6.380.0170.00514.47
5.6.370.0090.01314.34
5.6.360.0140.00714.41
5.6.350.0170.00914.29
5.6.340.0090.01214.44
5.6.330.0100.01114.34
5.6.320.0120.01114.19
5.6.310.0130.00414.06
5.6.300.0060.01514.35
5.6.290.0060.01514.32
5.6.280.0110.01014.06
5.6.270.0120.01014.42
5.6.260.0090.01014.22
5.6.250.0130.01014.29
5.6.240.0140.00914.10
5.6.230.0050.01614.37
5.6.220.0040.01914.44
5.6.210.0160.00914.27
5.6.200.0160.00614.17
5.6.190.0170.01113.94
5.6.180.0070.01513.96
5.6.170.0150.01114.17
5.6.160.0110.01014.11
5.6.150.0130.01114.34
5.6.140.0020.01914.03
5.6.130.0090.01214.38
5.6.120.0110.00914.19
5.6.110.0110.01114.33
5.6.100.0160.01014.23
5.6.90.0100.01314.43
5.6.80.0110.01114.17
5.6.70.0100.01413.90
5.6.60.0110.01114.28
5.6.50.0150.00714.20
5.6.40.0080.01414.17
5.6.30.0150.00714.11
5.6.20.0140.00914.23
5.6.10.0130.01114.33
5.6.00.0120.01114.22
5.5.380.0210.01513.91
5.5.370.0120.01014.05
5.5.360.0120.00914.00
5.5.350.0160.00914.33
5.5.340.0120.00814.32
5.5.330.0170.00714.09
5.5.320.0110.01414.09
5.5.310.0150.01114.33
5.5.300.0090.01414.52
5.5.290.0080.01614.17
5.5.280.0160.00814.34
5.5.270.0110.01014.07
5.5.260.0160.01014.36
5.5.250.0170.00714.31
5.5.240.0110.01014.41
5.5.230.0170.00714.06
5.5.220.0140.01114.38
5.5.210.0120.00914.04
5.5.200.0140.00814.15
5.5.190.0140.01114.19
5.5.180.0110.01314.18
5.5.170.0080.01614.33
5.5.160.0200.00614.22
5.5.150.0130.01014.27
5.5.140.0120.01213.84
5.5.130.0200.01114.13
5.5.120.0090.01414.13
5.5.110.0100.01614.18
5.5.100.0110.01613.94
5.5.90.0120.01414.12
5.5.80.0180.00914.10
5.5.70.0090.01314.11
5.5.60.0120.01314.02
5.5.50.0150.00914.17
5.5.40.0120.01014.11
5.5.30.0180.00914.35
5.5.20.0080.01414.11
5.5.10.0120.01314.23
5.5.00.0170.00814.14
5.4.450.0100.00711.89
5.4.440.0140.00712.01
5.4.430.0080.01012.02
5.4.420.0100.00611.96
5.4.410.0120.00511.84
5.4.400.0100.00511.91
5.4.390.0020.01711.71
5.4.380.0130.00611.86
5.4.370.0080.00911.91
5.4.360.0080.00911.77
5.4.350.0140.00511.86
5.4.340.0090.01011.96
5.4.330.0100.00911.90
5.4.320.0070.00811.87
5.4.310.0040.01511.91
5.4.300.0120.00511.71
5.4.290.0100.00611.75
5.4.280.0090.00811.84
5.4.270.0130.00611.75
5.4.260.0110.00811.88
5.4.250.0100.01011.87
5.4.240.0080.00811.98
5.4.230.0130.00511.83
5.4.220.0120.00811.70
5.4.210.0080.00911.90
5.4.200.0060.01011.84
5.4.190.0110.00811.91
5.4.180.0080.01211.89
5.4.170.0100.00812.02
5.4.160.0090.00911.99
5.4.150.0090.00911.95
5.4.140.0090.01111.85
5.4.130.0090.00911.97
5.4.120.0080.01011.89
5.4.110.0080.01211.89
5.4.100.0110.01111.82
5.4.90.0110.00911.92
5.4.80.0100.00711.94
5.4.70.0070.01111.79
5.4.60.0070.00911.79
5.4.50.0080.00911.79
5.4.40.0080.00811.89
5.4.30.0090.00711.82
5.4.20.0090.00911.81
5.4.10.0090.01011.93
5.4.00.0110.00611.94
5.3.290.0070.01411.69
5.3.280.0130.00711.69
5.3.270.0120.00811.69
5.3.260.0030.01411.69
5.3.250.0130.00811.69
5.3.240.0100.01211.69
5.3.230.0100.01011.69
5.3.220.0040.01411.69
5.3.210.0100.00911.69
5.3.200.0030.01711.69
5.3.190.0090.01111.69
5.3.180.0120.00711.70
5.3.170.0090.00811.69
5.3.160.0110.00611.69
5.3.150.0030.01411.69
5.3.140.0130.00411.69
5.3.130.0070.01011.69
5.3.120.0100.00711.69
5.3.110.0100.00811.69
5.3.100.0060.01211.69
5.3.90.0060.01011.69
5.3.80.0090.00611.69
5.3.70.0120.00411.69
5.3.60.0070.01311.69
5.3.50.0130.00711.69
5.3.40.0060.01011.69
5.3.30.0080.00811.69
5.3.20.0060.01611.69
5.3.10.0090.01111.69
5.3.00.0120.00911.69
5.2.170.0090.01211.69
5.2.160.0020.01311.69
5.2.150.0090.00811.69
5.2.140.0070.00911.69
5.2.130.0080.01011.69
5.2.120.0070.01111.69
5.2.110.0090.00911.69
5.2.100.0110.00811.69
5.2.90.0080.00811.69
5.2.80.0090.00811.69
5.2.70.0090.00911.69
5.2.60.0090.00911.69
5.2.50.0080.00911.69
5.2.40.0110.00811.69
5.2.30.0070.01011.69
5.2.20.0120.01011.69
5.2.10.0100.00511.69
5.2.00.0080.00911.69
5.1.60.0070.01311.69
5.1.50.0060.00811.69
5.1.40.0090.00611.69
5.1.30.0120.01011.69
5.1.20.0070.01211.69
5.1.10.0070.00811.69
5.1.00.0090.00811.69
5.0.50.0050.01311.69
5.0.40.0060.01011.69
5.0.30.0030.01511.69
5.0.20.0080.01211.69
5.0.10.0050.01011.69
5.0.00.0030.01211.69
4.4.90.0040.00411.69
4.4.80.0090.00011.69
4.4.70.0000.00811.69
4.4.60.0050.00211.69
4.4.50.0050.00211.69
4.4.40.0030.00611.69
4.4.30.0050.00311.69
4.4.20.0070.00211.69
4.4.10.0080.00011.69
4.4.00.0070.00111.69
4.3.110.0050.00211.69
4.3.100.0030.00511.69
4.3.90.0070.00211.69
4.3.80.0050.00511.69
4.3.70.0080.00011.69
4.3.60.0030.00511.69
4.3.50.0080.00211.69
4.3.40.0060.00311.69
4.3.30.0030.00611.69
4.3.20.0050.00411.69
4.3.10.0040.00411.69
4.3.00.0030.00311.69

preferences:
40.3 ms | 401 KiB | 5 Q