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( "loop" => 0, "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) {} $end = microtime(true) - $start; $times["loop"]+= $end; $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.0150.02116.28
7.4.50.0150.01716.02
7.4.40.0090.02216.21
7.4.30.0040.02516.29
7.4.20.0140.01816.36
7.4.10.0170.01416.33
7.4.00.0110.02216.47
7.3.180.0190.02616.37
7.3.170.0040.02916.39
7.3.160.0120.01916.21
7.3.150.0020.03116.32
7.3.140.0100.02316.38
7.3.130.0090.02216.41
7.3.120.0090.02815.47
7.3.110.0070.02915.58
7.3.100.0100.02215.60
7.3.90.0100.02215.66
7.3.80.0050.02815.51
7.3.70.0050.02715.61
7.3.60.0080.02415.43
7.3.50.0070.02815.63
7.3.40.0090.02015.52
7.3.30.0020.03015.56
7.3.20.0070.02716.39
7.3.10.0060.02316.41
7.3.00.0130.02116.32
7.2.310.0060.03116.44
7.2.300.0000.03416.52
7.2.290.0040.03116.59
7.2.280.0130.02316.27
7.2.270.0030.03216.42
7.2.260.0150.01816.45
7.2.250.0040.03016.41
7.2.240.0080.03015.88
7.2.230.0050.02715.74
7.2.220.0060.02915.75
7.2.210.0070.02515.85
7.2.200.0080.02415.66
7.2.190.0050.03015.76
7.2.180.0070.02615.74
7.2.170.0080.02815.75
7.2.160.0080.02515.58
7.2.150.0070.02716.55
7.2.140.0070.02316.75
7.2.130.0070.02316.67
7.2.120.0050.02716.72
7.2.110.0110.01916.73
7.2.100.0080.02616.64
7.2.90.0080.02516.68
7.2.80.0110.02116.80
7.2.70.0050.02916.74
7.2.60.0050.02616.73
7.2.50.0110.02316.58
7.2.40.0040.02916.75
7.2.30.0090.02616.84
7.2.20.0060.02716.62
7.2.10.0050.02716.60
7.2.00.0090.03116.59
7.1.330.0060.04915.69
7.1.320.0080.04715.64
7.1.310.0050.04615.53
7.1.300.0050.04615.58
7.1.290.0070.04915.72
7.1.280.0020.04915.67
7.1.270.0070.05115.57
7.1.260.0060.04915.56
7.1.250.0100.04415.69
7.1.240.0040.04115.38
7.1.230.0110.03815.47
7.1.220.0080.03815.45
7.1.210.0070.04015.51
7.1.200.0090.03515.48
7.1.190.0080.04115.54
7.1.180.0140.04115.39
7.1.170.0070.03815.42
7.1.160.0070.05715.49
7.1.150.0110.03515.54
7.1.140.0100.03715.45
7.1.130.0040.04315.45
7.1.120.0070.06415.27
7.1.110.0030.04715.34
7.1.100.0100.03815.32
7.1.90.0090.04215.26
7.1.80.0080.04315.33
7.1.70.0040.03316.14
7.1.60.0050.03717.54
7.1.50.0120.04116.26
7.1.40.0100.03915.27
7.1.30.0110.04015.41
7.1.20.0310.03515.55
7.1.10.0170.03015.51
7.1.00.0020.08018.96
7.0.330.0000.04214.86
7.0.320.0120.03515.03
7.0.310.0120.03515.07
7.0.300.0040.04315.22
7.0.290.0120.03415.02
7.0.280.0070.04314.94
7.0.270.0090.04215.10
7.0.260.0150.06215.14
7.0.250.0190.03515.05
7.0.240.0110.03815.01
7.0.230.0040.04515.14
7.0.220.0030.04815.02
7.0.210.0120.03815.14
7.0.200.0030.04116.08
7.0.190.0030.04715.14
7.0.180.0090.04115.22
7.0.170.0110.03515.02
7.0.160.0090.03415.08
7.0.150.0100.03415.32
7.0.140.0070.03815.08
7.0.130.0000.04915.32
7.0.120.0040.04214.98
7.0.110.0140.03615.11
7.0.100.0110.03714.83
7.0.90.0070.03715.18
7.0.80.0060.03815.21
7.0.70.0050.04115.08
7.0.60.0150.07317.60
7.0.50.0150.06416.41
7.0.40.0070.05517.62
7.0.30.0300.06417.60
7.0.20.0120.05417.49
7.0.10.0090.06517.62
7.0.00.0090.07817.65
5.6.400.0170.06415.73
5.6.390.0110.07115.76
5.6.380.0060.07315.73
5.6.370.0090.07115.78
5.6.360.0090.07215.81
5.6.350.0030.08115.67
5.6.340.0160.06515.97
5.6.330.0090.08916.07
5.6.320.0060.08015.89
5.6.310.0090.07715.84
5.6.300.0060.08115.88
5.6.290.0180.06915.92
5.6.280.0050.07715.61
5.6.270.0060.08115.72
5.6.260.0030.08016.05
5.6.250.0030.07415.58
5.6.240.0060.07415.66
5.6.230.0080.09315.92
5.6.220.0190.10415.70
5.6.210.0100.10918.21
5.6.200.0080.09916.94
5.6.190.0100.09418.12
5.6.180.0090.08118.11
5.6.170.0130.07818.01
5.6.160.0110.10318.15
5.6.150.0090.08816.96
5.6.140.0110.09916.93
5.6.130.0120.09316.94
5.6.120.0150.09618.53
5.6.110.0300.09318.38
5.6.100.0120.10118.63
5.6.90.0070.11318.45
5.6.80.0090.08918.03
5.6.70.0110.07815.59
5.6.60.0140.07515.93
5.6.50.0060.07615.39
5.6.40.0140.08715.74
5.6.30.0070.07815.89
5.6.20.0060.07715.68
5.6.10.0100.07415.87
5.6.00.0070.07415.73
5.5.380.0090.07315.69
5.5.370.0120.07115.63
5.5.360.0040.07915.78
5.5.350.0090.10618.17
5.5.340.0080.07816.77
5.5.330.0020.09317.97
5.5.320.1950.08118.08
5.5.310.0260.09418.06
5.5.300.0090.09017.00
5.5.290.0080.08916.87
5.5.280.0140.08618.31
5.5.270.0070.11618.31
5.5.260.0060.09918.34
5.5.250.0020.10718.16
5.5.240.0080.10817.96
5.5.230.0130.06715.66
5.5.220.0210.06315.93
5.5.210.0100.07415.61
5.5.200.0100.07315.84
5.5.190.0030.08016.07
5.5.180.0160.07315.85
5.5.170.0030.07915.65
5.5.160.0000.08515.80
5.5.150.0070.07315.75
5.5.140.0070.07315.59
5.5.130.0060.08115.40
5.5.120.0030.08015.75
5.5.110.0180.06815.77
5.5.100.0060.07515.82
5.5.90.0060.07815.98
5.5.80.0060.07615.77
5.5.70.0130.06815.77
5.5.60.0080.07215.64
5.5.50.0090.07415.68
5.5.40.0120.07115.61
5.5.30.0120.06415.75
5.5.20.0120.07015.69
5.5.10.0220.07615.82
5.5.00.0100.07415.70
5.4.450.0210.07315.98
5.4.440.0630.12616.03
5.4.430.0620.09515.96
5.4.420.0220.11516.13
5.4.410.0070.09415.79
5.4.400.0150.10715.58
5.4.390.0100.10315.56
5.4.380.0080.09515.63
5.4.370.0070.12515.79
5.4.360.0130.08815.64
5.4.350.0080.09815.61
5.4.340.0090.10115.47
5.4.330.0080.06912.56
5.4.320.0080.09415.61
5.4.310.0080.11115.62
5.4.300.0070.09915.71
5.4.290.0070.10015.68
5.4.280.0120.14215.63
5.4.270.0050.14115.68
5.4.260.0090.10215.44
5.4.250.0120.10315.58
5.4.240.0150.09215.72
5.4.230.0080.10115.55
5.4.220.0050.10115.64
5.4.210.0020.13315.66
5.4.200.0080.09714.68
5.4.190.0070.09815.60
5.4.180.0060.09915.66
5.4.170.0130.10015.64
5.4.160.0070.09515.65
5.4.150.0140.09015.57
5.4.140.0150.09614.46
5.4.130.0170.09114.42
5.4.120.0130.08914.45
5.4.110.0080.13614.47
5.4.100.0140.08714.44
5.4.90.0080.09414.51
5.4.80.0120.08814.55
5.4.70.0060.11514.54
5.4.60.0050.10914.37
5.4.50.0080.12214.56
5.4.40.0070.09714.37
5.4.30.0100.09114.53
5.4.20.0050.10414.60
5.4.10.0120.09114.45
5.4.00.0110.08714.22
5.3.290.0050.14214.13
5.3.280.0050.14313.82
5.3.270.0050.14113.96
5.3.260.0100.12913.99
5.3.250.0110.14013.89
5.3.240.0100.13113.98
5.3.230.0030.14713.91
5.3.220.0120.18913.84
5.3.210.0100.13613.87
5.3.200.0070.13113.93
5.3.190.0030.15913.89
5.3.180.0130.13714.03
5.3.170.0080.15513.98
5.3.160.0100.13513.94
5.3.150.0110.12713.96
5.3.140.0070.13213.89
5.3.130.0100.13613.91
5.3.120.0080.13613.97
5.3.110.0090.13313.81
5.3.100.0070.16013.63
5.3.90.0110.15213.68
5.3.80.0050.14913.54
5.3.70.0100.13713.61
5.3.60.0030.13713.62
5.3.50.0080.13113.53
5.3.40.0090.13813.50
5.3.30.0080.16413.58
5.3.20.0050.14513.40
5.3.10.0110.13313.38
5.3.00.0100.15813.30
5.2.170.0080.14411.71
5.2.160.0080.16011.75
5.2.150.0100.15511.66
5.2.140.0050.16911.70
5.2.130.0110.17311.53
5.2.120.0080.14211.61
5.2.110.0070.16511.61
5.2.100.0120.16611.73
5.2.90.0070.14911.54
5.2.80.0080.16311.62
5.2.70.0070.14811.62
5.2.60.0080.15911.45
5.2.50.0110.14211.57
5.2.40.0060.15411.56
5.2.30.0080.15211.45
5.2.20.0120.15311.51
5.2.10.0080.15011.35
5.2.00.0110.15711.29
5.1.60.0080.13710.69
5.1.50.0030.15810.63
5.1.40.0050.14410.69
5.1.30.0060.13710.85
5.1.20.0030.16410.84
5.1.10.0060.16410.60
5.1.00.0060.15610.73
5.0.50.0220.2579.50
5.0.40.0090.2439.41
5.0.30.0280.2359.32
5.0.20.0130.2799.35
5.0.10.0270.2429.32
5.0.00.0120.3149.27
4.4.90.0010.0158.13
4.4.80.0030.0138.12
4.4.70.0060.0108.11
4.4.60.0020.0138.16
4.4.50.0040.0128.13
4.4.40.0000.0218.14
4.4.30.0000.0148.13
4.4.20.0030.0118.21
4.4.10.0020.0198.15
4.4.00.0010.0258.18
4.3.110.0030.0138.09
4.3.100.0080.0138.07
4.3.90.0040.0128.06
4.3.80.0060.0168.07
4.3.70.0020.0198.08
4.3.60.0020.0148.11
4.3.50.0090.0088.09
4.3.40.0000.0218.09
4.3.30.0020.0137.44
4.3.20.0020.0127.46
4.3.10.0080.0087.44
4.3.00.0070.00812.94

preferences:
57.89 ms | 403 KiB | 5 Q