3v4l.org

run code in 300+ PHP versions simultaneously
<?php function report($name, $time) { static $last = null; printf("%-12s: %.8fms", $name, $time); if (null !== $last) { printf(", %.1f%%", (($time - $last)/$last)*100); } echo PHP_EOL; $last = $time; } $iterations = 100000; $a = str_repeat('a', 2<<8); $times = array( "direct" => 0, "static" => 0, "object" => 0 ); class Os { public static function strcmp($a) { strcmp($a, $a); } } class Om { public function strcmp($a) { strcmp($a, $a); } } $o = new Om(); $start = microtime(true); for ($x=0; $x<$iterations; $x++) { strcmp($a, $a); } $end = microtime(true) - $start; $times["direct"]+= $end; $start = microtime(true); for ($x=0; $x<$iterations; $x++) { Os::strcmp($a); } $end = microtime(true) - $start; $times["static"]+= $end; $start = microtime(true); for ($x=0; $x<$iterations; $x++) { $o->strcmp($a); } $end = microtime(true) - $start; $times["object"]+= $end; foreach ($times as $name => $time) { report($name, ($time/$iterations)*1000); }

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.60.0120.03516.13
7.4.50.0090.03616.34
7.4.40.0080.02816.21
7.4.30.0060.03216.24
7.4.20.0080.03116.40
7.4.10.0130.01916.27
7.4.00.0080.02416.47
7.3.180.0120.03316.31
7.3.170.0120.02816.10
7.3.160.0110.03016.35
7.3.150.0150.03116.37
7.3.140.0170.01716.24
7.3.130.0130.02016.38
7.3.120.0100.02116.46
7.3.110.0130.02716.36
7.3.100.0030.02916.43
7.3.90.0060.02516.44
7.3.80.0130.01816.22
7.3.70.0070.02516.46
7.3.60.0080.02516.18
7.3.50.0040.02716.34
7.3.40.0090.02416.15
7.3.30.0090.03716.27
7.3.20.0110.02216.21
7.3.10.0120.03616.26
7.3.00.0050.02616.47
7.2.310.0120.03116.40
7.2.300.0110.02616.41
7.2.290.0190.02916.47
7.2.280.0090.02816.43
7.2.270.0130.02316.37
7.2.260.0080.02816.45
7.2.250.0030.03016.32
7.2.240.0080.03416.55
7.2.230.0080.02616.25
7.2.220.0060.02816.48
7.2.210.0120.02116.48
7.2.200.0060.02916.61
7.2.190.0170.01716.48
7.2.180.0040.03116.55
7.2.170.0140.02016.53
7.2.160.0060.03316.38
7.2.150.0110.02516.39
7.2.140.0180.01916.66
7.2.130.0050.02816.71
7.2.120.0090.02616.71
7.2.110.0060.02916.61
7.2.100.0120.03216.48
7.2.90.0070.02516.62
7.2.80.0070.03016.61
7.2.70.0100.02316.66
7.2.60.0070.02916.70
7.2.50.0060.02616.72
7.2.40.0120.02816.83
7.2.30.0140.02016.81
7.2.20.0070.02916.68
7.2.10.0070.02616.66
7.2.00.0050.02717.55
7.1.330.0070.04115.68
7.1.320.0540.03915.36
7.1.310.0180.05415.45
7.1.300.0080.03915.70
7.1.290.0130.03915.59
7.1.280.0060.04315.45
7.1.270.0040.06915.27
7.1.260.0310.03615.37
7.1.250.0000.05215.54
7.1.240.0070.04715.60
7.1.230.0060.05115.45
7.1.220.0080.04315.46
7.1.210.0110.04015.66
7.1.200.0070.04815.63
7.1.190.0070.04815.56
7.1.180.0100.04415.57
7.1.170.0080.04715.72
7.1.160.0260.04415.71
7.1.150.0050.04915.64
7.1.140.0040.04915.64
7.1.130.0110.04315.61
7.1.120.0110.04615.65
7.1.110.0100.04215.68
7.1.100.0240.04715.48
7.1.90.0090.04915.56
7.1.80.0080.05315.59
7.1.70.0050.04316.06
7.1.60.0050.05416.96
7.1.50.0080.04816.05
7.1.40.0050.05715.60
7.1.30.0070.04415.55
7.1.20.0070.04715.54
7.1.10.0040.05215.54
7.1.00.0060.07217.77
7.0.330.0070.04415.32
7.0.320.0070.04615.12
7.0.310.0020.05015.25
7.0.300.0100.04715.29
7.0.290.0030.04715.37
7.0.280.0090.04415.21
7.0.270.0050.04715.13
7.0.260.0060.05015.24
7.0.250.0050.04915.25
7.0.240.0100.04515.20
7.0.230.0140.03915.35
7.0.220.0100.04415.33
7.0.210.0120.04415.27
7.0.200.0110.03715.85
7.0.190.0060.04615.25
7.0.180.0050.05215.42
7.0.170.0060.04615.12
7.0.160.0070.04515.31
7.0.150.0110.04615.26
7.0.140.0090.04815.29
7.0.130.0100.04515.38
7.0.120.0170.04215.22
7.0.110.0090.04715.34
7.0.100.0080.04615.40
7.0.90.0100.04615.30
7.0.80.0020.05115.42
7.0.70.0070.04515.13
7.0.60.0160.06316.88
7.0.50.0120.06616.11
7.0.40.0060.06216.18
7.0.30.0230.04716.25
7.0.20.0150.07316.24
7.0.10.0040.06616.17
7.0.00.0050.05416.11
5.6.400.0030.07715.70
5.6.390.0140.06915.87
5.6.380.0060.08415.16
5.6.370.0050.09515.23
5.6.360.0100.09115.23
5.6.350.0080.08315.19
5.6.340.0130.08115.13
5.6.330.0110.08315.14
5.6.320.0110.08315.22
5.6.310.0090.08815.14
5.6.300.0060.08815.10
5.6.290.0140.08715.18
5.6.280.0070.08517.16
5.6.270.0090.08715.02
5.6.260.0030.09615.19
5.6.250.0090.08415.04
5.6.240.0110.07915.24
5.6.230.0070.08615.05
5.6.220.0080.08315.23
5.6.210.0070.09816.83
5.6.200.0060.08416.16
5.6.190.0050.10317.05
5.6.180.1290.08316.92
5.6.170.0120.09416.79
5.6.160.0090.10416.83
5.6.150.0040.09016.13
5.6.140.0070.10516.20
5.6.130.0070.11016.20
5.6.120.0060.09517.20
5.6.110.0070.10817.21
5.6.100.0050.08717.00
5.6.90.0080.10117.02
5.6.80.0040.08716.71
5.6.70.0060.08715.10
5.6.60.0110.08715.01
5.6.50.0060.09614.93
5.6.40.0060.08815.22
5.6.30.0120.08315.07
5.6.20.0080.08615.17
5.6.10.0130.08015.14
5.6.00.0060.09715.18
5.5.380.0100.08213.61
5.5.370.0090.08513.53
5.5.360.0070.09613.55
5.5.350.1170.08515.71
5.5.340.0090.09915.00
5.5.330.0140.09915.74
5.5.320.0160.10315.75
5.5.310.0070.08615.77
5.5.300.0070.10615.00
5.5.290.0110.07915.08
5.5.280.0100.11615.96
5.5.270.0080.10715.99
5.5.260.0080.10616.02
5.5.250.0060.08715.96
5.5.240.0130.09215.64
5.5.230.0080.08513.51
5.5.220.0100.08813.50
5.5.210.0030.10413.48
5.5.200.0070.08513.47
5.5.190.0070.09113.47
5.5.180.0110.08713.57
5.5.170.0100.08213.41
5.5.160.0030.09113.45
5.5.150.0030.10813.56
5.5.140.0080.08913.54
5.5.130.0070.08713.41
5.5.120.0070.08713.57
5.5.110.0050.08713.34
5.5.100.0060.08613.36
5.5.90.0070.08213.54
5.5.80.0090.08213.35
5.5.70.0070.08313.52
5.5.60.0070.08913.59
5.5.50.0030.09713.61
5.5.40.0040.08313.36
5.5.30.0060.08313.47
5.5.20.0050.08513.50
5.5.10.0090.08413.43
5.5.00.0140.09013.51
5.4.450.0380.09414.36
5.4.440.0110.09614.47
5.4.430.0190.09714.57
5.4.420.0050.10314.43
5.4.410.0060.09814.19
5.4.400.0060.10214.17
5.4.390.0030.10214.20
5.4.380.0050.10614.19
5.4.370.0110.10714.18
5.4.360.0040.10314.17
5.4.350.0060.10214.20
5.4.340.0090.09614.09
5.4.330.0050.08911.90
5.4.320.0080.09914.29
5.4.310.0070.10814.12
5.4.300.0020.10214.20
5.4.290.0080.10014.09
5.4.280.0110.10014.16
5.4.270.0100.09614.23
5.4.260.0070.09314.20
5.4.250.0020.09914.15
5.4.240.0100.09414.23
5.4.230.0110.09214.20
5.4.220.0060.09914.22
5.4.210.0090.09814.24
5.4.200.0050.10113.53
5.4.190.0050.09514.18
5.4.180.0110.09314.15
5.4.170.0090.10014.13
5.4.160.0130.09914.11
5.4.150.0090.09714.17
5.4.140.0080.10613.45
5.4.130.0080.10613.39
5.4.120.0070.09913.33
5.4.110.0080.10313.46
5.4.100.0080.09213.35
5.4.90.0070.10413.42
5.4.80.0090.09313.41
5.4.70.0060.12013.46
5.4.60.0070.09813.38
5.4.50.0090.09313.32
5.4.40.0070.09813.32
5.4.30.0040.10913.35
5.4.20.0080.09613.38
5.4.10.0060.10413.42
5.4.00.0080.09613.26
5.3.290.0080.14213.09
5.3.280.0050.13513.00
5.3.270.0050.13713.06
5.3.260.0090.16013.07
5.3.250.0100.14213.03
5.3.240.0080.13712.92
5.3.230.0070.14913.05
5.3.220.0050.13912.98
5.3.210.0120.14512.91
5.3.200.0100.14013.05
5.3.190.0060.13913.04
5.3.180.0040.14412.96
5.3.170.0040.13912.96
5.3.160.0100.14213.02
5.3.150.0070.13312.95
5.3.140.0120.17112.99
5.3.130.0060.14113.00
5.3.120.0070.13812.97
5.3.110.0100.13312.97
5.3.100.0050.14412.89
5.3.90.0090.14612.88
5.3.80.0050.13912.81
5.3.70.0070.13312.77
5.3.60.0070.14412.76
5.3.50.0060.13812.83
5.3.40.0130.13512.82
5.3.30.0060.15012.80
5.3.20.0110.15012.72
5.3.10.0050.14012.72
5.3.00.0060.13512.59
5.2.170.0090.14511.57
5.2.160.0050.15011.49
5.2.150.0070.15111.48
5.2.140.0060.15211.54
5.2.130.0020.15411.43
5.2.120.0070.14711.51
5.2.110.0060.14811.45
5.2.100.0060.14811.45
5.2.90.0080.14511.44
5.2.80.0060.15011.43
5.2.70.0070.14511.45
5.2.60.0060.14311.36
5.2.50.0050.14611.37
5.2.40.0070.14911.45
5.2.30.0070.14911.40
5.2.20.0110.14111.38
5.2.10.0060.13111.32
5.2.00.0070.15011.24
5.1.60.0030.14310.77
5.1.50.0100.14110.87
5.1.40.0070.13810.76
5.1.30.0080.13511.03
5.1.20.0070.13610.90
5.1.10.0020.14910.79
5.1.00.0070.13510.83
5.0.50.0030.26410.10
5.0.40.0020.25110.01
5.0.30.0070.2569.99
5.0.20.0040.2489.93
5.0.10.0040.2449.97
5.0.00.0080.2639.97
4.4.90.0020.0119.14
4.4.80.0020.0109.13
4.4.70.0000.0129.15
4.4.60.0030.0109.15
4.4.50.0000.0139.15
4.4.40.0010.0159.15
4.4.30.0000.0149.13
4.4.20.0010.0129.19
4.4.10.0040.0089.17
4.4.00.0030.0149.14
4.3.110.0040.0099.13
4.3.100.0030.0099.13
4.3.90.0020.0109.11
4.3.80.0040.0129.11
4.3.70.0010.0119.13
4.3.60.0030.0099.11
4.3.50.0020.0099.13
4.3.40.0030.0129.13
4.3.30.0030.0098.70
4.3.20.0010.0118.69
4.3.10.0020.0098.70
4.3.00.0100.00712.35

preferences:
61.98 ms | 403 KiB | 5 Q