3v4l.org

run code in 300+ PHP versions simultaneously
<?php function report($name, $time, $base) { printf("%-12s: %.8fms", $name, $time); printf(", %.1f%%", (($time - $base)/$base)*100); echo PHP_EOL; } $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, ($times['loop']/$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.01816.50
7.4.50.0190.01016.29
7.4.40.0070.02316.20
7.4.30.0060.02916.15
7.4.20.0110.01916.37
7.4.10.0120.01816.16
7.4.00.0090.02515.91
7.3.180.0110.01916.33
7.3.170.0000.03016.27
7.3.160.0000.03116.29
7.3.150.0130.01816.25
7.3.140.0030.02916.29
7.3.130.0070.02416.38
7.3.120.0070.02815.56
7.3.110.0160.02115.41
7.3.100.0130.01915.53
7.3.90.0020.03015.56
7.3.80.0100.02015.30
7.3.70.0080.02415.56
7.3.60.0060.02615.48
7.3.50.0090.02115.56
7.3.40.0070.02615.51
7.3.30.0050.02515.53
7.3.20.0050.02616.39
7.3.10.0060.02316.50
7.3.00.0070.02616.44
7.2.310.0070.02416.34
7.2.300.0130.02216.77
7.2.290.0050.02816.60
7.2.280.0000.03516.39
7.2.270.0110.02316.48
7.2.260.0100.02416.43
7.2.250.0070.03215.96
7.2.240.0060.03115.73
7.2.230.0100.02215.81
7.2.220.0070.02415.80
7.2.210.0060.02415.69
7.2.200.0050.02915.69
7.2.190.0030.02815.73
7.2.180.0050.02715.79
7.2.170.0080.02515.79
7.2.160.0100.02316.48
7.2.150.0080.02616.50
7.2.140.0160.01916.60
7.2.130.0050.02616.60
7.2.120.0070.02516.71
7.2.110.0160.02416.73
7.2.100.0080.02616.61
7.2.90.0130.02116.67
7.2.80.0110.03016.72
7.2.70.0070.03016.82
7.2.60.0080.02516.70
7.2.50.0080.02916.63
7.2.40.0070.02716.68
7.2.30.0080.02616.72
7.2.20.0100.02616.61
7.2.10.0060.02816.74
7.2.00.0020.03116.75
7.1.330.0100.04115.75
7.1.320.0110.03915.74
7.1.310.0080.04215.64
7.1.300.0120.04415.70
7.1.290.0060.04315.60
7.1.280.0070.04415.54
7.1.270.0050.04815.68
7.1.260.0040.04515.53
7.1.250.0060.04415.57
7.1.240.0080.03915.33
7.1.230.0040.04115.33
7.1.220.0070.04115.32
7.1.210.0090.03615.48
7.1.200.0120.05015.34
7.1.190.0040.05015.42
7.1.180.0160.03315.42
7.1.170.0150.05115.28
7.1.160.0070.04915.46
7.1.150.0060.04715.43
7.1.140.0190.04615.29
7.1.130.0040.04215.47
7.1.120.0040.04815.28
7.1.110.0080.04215.61
7.1.100.0110.04415.39
7.1.90.0030.06615.47
7.1.80.0040.04015.10
7.1.70.0050.03016.27
7.1.60.0070.04417.44
7.1.50.0100.04416.13
7.1.40.0070.03815.33
7.1.30.0100.03815.44
7.1.20.0090.04015.42
7.1.10.0100.03715.36
7.1.00.0070.07618.93
7.0.330.0130.03314.95
7.0.320.0080.03914.79
7.0.310.0140.06315.01
7.0.300.0030.04114.95
7.0.290.0130.03515.15
7.0.280.0260.04315.20
7.0.270.0000.04514.86
7.0.260.0040.05514.99
7.0.250.0070.03815.22
7.0.240.0090.04215.01
7.0.230.0000.04415.07
7.0.220.0100.04514.86
7.0.210.0040.04215.09
7.0.200.0080.03115.95
7.0.190.0110.03414.96
7.0.180.0000.04515.06
7.0.170.0040.04515.12
7.0.160.0040.04015.16
7.0.150.0130.03315.06
7.0.140.0130.03615.06
7.0.130.0050.04415.02
7.0.120.0230.03515.16
7.0.110.0150.03615.03
7.0.100.0270.04014.93
7.0.90.0000.04715.09
7.0.80.0150.04314.94
7.0.70.0130.03214.86
7.0.60.0080.06817.51
7.0.50.0130.07416.48
7.0.40.0100.07217.56
7.0.30.0310.06617.48
7.0.20.0290.06617.61
7.0.10.0130.07617.63
7.0.00.0080.07617.64
5.6.400.0100.07415.69
5.6.390.0130.06815.75
5.6.380.0120.07615.75
5.6.370.0030.10115.81
5.6.360.0160.07115.93
5.6.350.0070.07715.80
5.6.340.0000.08215.60
5.6.330.0030.08015.58
5.6.320.0060.07815.75
5.6.310.0140.06715.82
5.6.300.0120.07816.16
5.6.290.0130.07115.51
5.6.280.0040.10618.43
5.6.270.0170.07815.86
5.6.260.0090.07615.67
5.6.250.0170.07616.01
5.6.240.0080.08315.80
5.6.230.0000.08515.83
5.6.220.0060.09416.11
5.6.210.0120.08318.17
5.6.200.0180.13216.95
5.6.190.0090.08118.12
5.6.180.2080.07418.08
5.6.170.0250.08018.02
5.6.160.0050.11018.13
5.6.150.0120.07916.96
5.6.140.0070.11117.02
5.6.130.0060.10517.02
5.6.120.0080.09718.47
5.6.110.0120.10618.33
5.6.100.0070.08718.44
5.6.90.0100.11418.35
5.6.80.0120.09818.11
5.6.70.0060.07815.84
5.6.60.0030.08115.72
5.6.50.0000.08815.66
5.6.40.0030.08115.70
5.6.30.0100.07415.79
5.6.20.0140.07916.03
5.6.10.0100.07616.03
5.6.00.0140.08015.89
5.5.380.0220.07115.76
5.5.370.0110.07115.72
5.5.360.0110.07315.74
5.5.350.0170.08018.02
5.5.340.0040.08216.84
5.5.330.0090.11018.15
5.5.320.0200.10417.94
5.5.310.0200.10718.05
5.5.300.0050.10416.82
5.5.290.0190.07816.92
5.5.280.0050.09218.26
5.5.270.0060.11018.29
5.5.260.0080.08218.11
5.5.250.0070.08218.06
5.5.240.0160.10217.95
5.5.230.0080.07515.77
5.5.220.0180.07415.68
5.5.210.0030.08415.61
5.5.200.0100.07515.74
5.5.190.0130.07115.87
5.5.180.0100.07215.88
5.5.170.0090.08015.81
5.5.160.0140.06615.50
5.5.150.0190.07115.69
5.5.140.0040.08015.80
5.5.130.0000.08115.80
5.5.120.0110.07715.72
5.5.110.0080.07715.48
5.5.100.0090.07415.84
5.5.90.0160.07215.57
5.5.80.0100.07315.86
5.5.70.0090.07215.83
5.5.60.0160.06415.78
5.5.50.0230.07415.78
5.5.40.0060.08715.74
5.5.30.0150.07515.52
5.5.20.0060.07815.62
5.5.10.0070.08115.83
5.5.00.0060.07915.58
5.4.450.0300.08916.00
5.4.440.0200.07316.06
5.4.430.0100.09716.06
5.4.420.0100.10116.02
5.4.410.0100.09115.66
5.4.400.0080.09415.64
5.4.390.0090.10915.78
5.4.380.0080.09915.62
5.4.370.0120.09215.61
5.4.360.0120.09315.56
5.4.350.0140.09315.66
5.4.340.0120.09315.68
5.4.330.0060.07412.44
5.4.320.0110.09515.71
5.4.310.0100.09715.64
5.4.300.0080.10515.63
5.4.290.0150.08915.62
5.4.280.0080.09315.75
5.4.270.0080.10315.61
5.4.260.0110.09315.65
5.4.250.0120.09115.65
5.4.240.0120.09115.58
5.4.230.0050.09915.62
5.4.220.0130.09715.71
5.4.210.0120.09115.50
5.4.200.0050.10114.69
5.4.190.0060.09715.56
5.4.180.0120.09815.54
5.4.170.0080.09815.57
5.4.160.0070.10015.59
5.4.150.0050.10215.56
5.4.140.0100.09214.50
5.4.130.0100.09414.46
5.4.120.0210.08614.44
5.4.110.0020.10114.53
5.4.100.0110.09214.42
5.4.90.0070.09714.52
5.4.80.0080.09114.43
5.4.70.0070.09814.56
5.4.60.0130.09314.47
5.4.50.0100.09414.52
5.4.40.0110.11414.53
5.4.30.0070.12114.51
5.4.20.0060.12014.48
5.4.10.0080.10814.42
5.4.00.0090.10214.25
5.3.290.0090.13414.11
5.3.280.0120.12913.89
5.3.270.0060.14713.98
5.3.260.0100.16314.00
5.3.250.0080.14513.98
5.3.240.0070.13213.98
5.3.230.0080.15213.90
5.3.220.0150.14013.86
5.3.210.0140.13913.86
5.3.200.0120.13513.88
5.3.190.0080.13613.81
5.3.180.0160.13313.91
5.3.170.0040.14913.85
5.3.160.0090.18113.94
5.3.150.0080.13413.92
5.3.140.0050.13613.89
5.3.130.0190.16913.90
5.3.120.0100.15913.92
5.3.110.0100.15013.90
5.3.100.0080.13313.60
5.3.90.0110.14313.63
5.3.80.0100.14913.61
5.3.70.0140.13413.60
5.3.60.0180.13813.56
5.3.50.0100.13013.63
5.3.40.0140.13613.62
5.3.30.0050.13113.67
5.3.20.0080.14513.44
5.3.10.0080.14913.29
5.3.00.0120.13213.24
5.2.170.0120.15011.64
5.2.160.0030.15111.61
5.2.150.0070.15611.66
5.2.140.0120.14911.71
5.2.130.0100.19611.52
5.2.120.0090.14711.69
5.2.110.0110.15511.59
5.2.100.0100.15111.68
5.2.90.0050.14411.60
5.2.80.0000.15211.55
5.2.70.0000.15011.67
5.2.60.0020.15311.51
5.2.50.0100.13911.55
5.2.40.0110.14811.58
5.2.30.0080.14911.61
5.2.20.0060.15311.37
5.2.10.0070.14311.39
5.2.00.0070.15311.21
5.1.60.0080.14510.60
5.1.50.0110.13510.59
5.1.40.0120.14210.64
5.1.30.0080.14210.84
5.1.20.0120.12910.81
5.1.10.0060.14110.67
5.1.00.0030.14810.56
5.0.50.0130.2429.50
5.0.40.0080.2429.41
5.0.30.0080.2389.34
5.0.20.0160.2409.33
5.0.10.0120.2399.34
5.0.00.0120.2549.29
4.4.90.0050.0108.16
4.4.80.0020.0148.12
4.4.70.0050.0118.16
4.4.60.0090.0108.12
4.4.50.0050.0108.12
4.4.40.0000.0218.12
4.4.30.0030.0138.13
4.4.20.0000.0168.16
4.4.10.0020.0148.15
4.4.00.0080.0158.14
4.3.110.0020.0148.12
4.3.100.0000.0168.10
4.3.90.0030.0118.12
4.3.80.0050.0178.13
4.3.70.0040.0138.09
4.3.60.0030.0118.08
4.3.50.0050.0118.10
4.3.40.0040.0178.07
4.3.30.0040.0107.46
4.3.20.0020.0177.45
4.3.10.0020.0157.42
4.3.00.0020.00812.92

preferences:
29.45 ms | 403 KiB | 5 Q