3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buf = ''; report_memory(__LINE__); $buf = implode(range(1,PHP_MAX_INT)); report_memory(__LINE__); example($buf); report_memory(__LINE__); example2($buf); report_memory(__LINE__); function example($str) { report_memory(__LINE__); is_string($str); report_memory(__LINE__); } function example2(& $str) { report_memory(__LINE__); is_string($str); report_memory(__LINE__); } function report_memory($line=0) { echo 'Line: ' . str_pad($line,3) . ' '; echo 'Mem: ' . str_pad(intval(memory_get_usage()/1024 ) . 'K',8) . ' '; echo 'Peak: ' . str_pad(intval(memory_get_peak_usage()/1024) . 'K',8) . ' '; echo "\n"; }

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.10.0060.01315.04
7.4.00.0080.00814.83
7.3.130.0060.01015.03
7.3.120.0070.01314.67
7.3.110.0040.01514.56
7.3.100.0070.00714.64
7.3.90.0040.00414.82
7.3.80.0030.00714.66
7.3.70.0000.01714.74
7.3.60.0060.00614.63
7.3.50.0030.00614.69
7.3.40.0070.00714.70
7.3.30.0030.00914.62
7.3.20.0030.01416.68
7.3.10.0000.01516.68
7.3.00.0070.00716.68
7.2.260.0040.01415.09
7.2.250.0070.01115.13
7.2.240.0070.00714.88
7.2.230.0030.01214.91
7.2.220.0080.00815.11
7.2.210.0000.01014.83
7.2.200.0000.00915.17
7.2.190.0100.00615.00
7.2.180.0040.01215.05
7.2.170.0030.01014.76
7.2.160.0040.00714.75
7.2.150.0000.01616.96
7.2.140.0110.00316.93
7.2.130.0040.01116.79
7.2.120.0100.00617.07
7.2.110.0030.01016.70
7.2.100.0000.01616.89
7.2.90.0000.01016.78
7.2.80.0030.00716.88
7.2.70.0100.00716.98
7.2.60.0030.01016.71
7.2.50.0090.00617.12
7.2.40.0040.01117.00
7.2.30.0100.00316.68
7.2.20.0100.00616.95
7.2.10.0040.00717.09
7.2.00.0050.00818.24
7.1.330.0100.00316.02
7.1.320.0030.00515.99
7.1.310.0070.00715.83
7.1.300.0040.00415.86
7.1.290.0120.00315.73
7.1.280.0000.01315.72
7.1.270.0030.00615.81
7.1.260.0040.00415.84
7.1.250.0060.00315.84
7.1.240.0060.00615.70
7.1.230.0090.00315.89
7.1.220.0000.01215.78
7.1.210.0060.00915.79
7.1.200.0060.00315.70
7.1.190.0100.00015.88
7.1.180.0030.01015.81
7.1.170.0060.00915.65
7.1.160.0060.00315.81
7.1.150.0000.01115.87
7.1.140.0060.00915.80
7.1.130.0100.00315.89
7.1.120.0090.00615.54
7.1.110.0030.01015.89
7.1.100.0080.00415.85
7.1.90.0000.01315.55
7.1.80.0070.01015.85
7.1.70.0050.00816.36
7.1.60.0100.01017.55
7.1.50.0050.01116.31
7.1.40.0110.00315.57
7.1.30.0100.00615.95
7.1.20.0090.00615.54
7.1.10.0060.00315.71
7.1.00.0050.04219.04
7.0.330.0090.00315.44
7.0.320.0000.01315.04
7.0.310.0070.00715.61
7.0.300.0000.01515.52
7.0.290.0070.00715.24
7.0.280.0030.00615.19
7.0.270.0120.00315.45
7.0.260.0080.00315.29
7.0.250.0080.00015.41
7.0.240.0070.00415.20
7.0.230.0040.01115.31
7.0.220.0030.01015.14
7.0.210.0050.00515.41
7.0.200.0030.00916.00
7.0.190.0050.00315.34
7.0.180.0060.00915.42
7.0.170.0060.00315.44
7.0.160.0040.01215.45
7.0.150.0030.00915.32
7.0.140.0060.02218.73
7.0.130.0090.00315.30
7.0.120.0100.00015.57
7.0.110.0040.00815.32
7.0.100.0140.00015.40
7.0.90.0000.01515.52
7.0.80.0090.00315.60
7.0.70.0030.01315.71
7.0.60.0080.04317.75
7.0.50.0100.03216.68
7.0.40.0070.04716.78
7.0.30.0170.02816.89
7.0.20.0200.03716.77
7.0.10.0070.04316.81
7.0.00.0070.04216.79
5.6.400.0090.00314.61
5.6.390.0000.00914.18
5.6.380.0060.00914.63
5.6.370.0060.00614.51
5.6.360.0070.01014.48
5.6.350.0070.00314.11
5.6.340.0090.00314.03
5.6.330.0030.00913.99
5.6.320.0070.00714.52
5.6.310.0070.00714.63
5.6.300.0000.01414.28
5.6.290.0130.00014.26
5.6.280.0100.03517.54
5.6.270.0000.01214.21
5.6.260.0040.00814.48
5.6.250.0070.01014.45
5.6.240.0070.00314.37
5.6.230.0070.01014.25
5.6.220.0000.01214.25
5.6.210.0130.03217.49
5.6.200.0050.03016.42
5.6.190.0060.03417.33
5.6.180.0160.03617.49
5.6.170.0080.03517.37
5.6.160.0000.05217.42
5.6.150.0020.04116.20
5.6.140.0050.04816.20
5.6.130.0070.04316.13
5.6.120.0050.04517.66
5.6.110.0020.05117.52
5.6.100.0080.02717.71
5.6.90.0100.04617.60
5.6.80.0100.03817.19
5.6.70.0070.00714.02
5.6.60.0000.01014.38
5.6.50.0000.01114.16
5.6.40.0040.00714.13
5.6.30.0040.00814.33
5.6.20.0030.01214.09
5.6.10.0000.00814.35
5.6.00.0060.00914.14
5.5.380.0000.00914.38
5.5.370.0120.00314.27
5.5.360.0100.00313.91
5.5.350.0080.02317.25
5.5.340.0070.02316.15
5.5.330.0050.04317.50
5.5.320.0120.03917.32
5.5.310.0160.03017.25
5.5.300.0030.02616.11
5.5.290.0080.04216.10
5.5.280.0050.04817.52
5.5.270.0080.03017.41
5.5.260.0090.03017.51
5.5.250.0080.04017.32
5.5.240.0050.04017.09
5.5.230.0000.00914.10
5.5.220.0090.00614.25
5.5.210.0060.00614.38
5.5.200.0080.00514.08
5.5.190.0040.01114.06
5.5.180.0040.00814.05
5.5.170.0040.01414.17
5.5.160.0110.00414.17
5.5.150.0060.00614.06
5.5.140.0090.00013.98
5.5.130.0090.00613.82
5.5.120.0100.00314.29
5.5.110.0080.00814.42
5.5.100.0060.01014.13
5.5.90.0000.01114.29
5.5.80.0100.00314.13
5.5.70.0090.00613.90
5.5.60.0090.00614.10
5.5.50.0040.00814.40
5.5.40.0090.00613.95
5.5.30.0090.00614.13
5.5.20.0050.00514.23
5.5.10.0060.00914.28
5.5.00.0090.00614.20
5.4.450.0180.02815.07
5.4.440.0460.03215.23
5.4.430.0300.03215.21
5.4.420.0480.03515.20
5.4.410.0110.02815.30
5.4.400.0350.03415.04
5.4.390.0380.03215.14
5.4.380.0200.03514.90
5.4.370.0120.03314.93
5.4.360.0170.02514.84
5.4.350.0140.03414.76
5.4.340.0120.03314.95
5.4.330.0000.01311.03
5.4.320.0180.03114.69
5.4.310.0150.03214.95
5.4.300.0170.02814.93
5.4.290.0190.02914.66
5.4.280.0170.03014.78
5.4.270.0100.03714.88
5.4.260.0170.04014.74
5.4.250.0150.03114.83
5.4.240.0180.03014.74
5.4.230.0240.03315.03
5.4.220.0100.03414.98
5.4.210.0130.03114.67
5.4.200.0150.03313.93
5.4.190.0130.03514.90
5.4.180.0160.03714.68
5.4.170.0200.03214.86
5.4.160.0250.02814.62
5.4.150.0100.03614.92
5.4.140.0140.02813.53
5.4.130.0190.02613.69
5.4.120.0130.02913.71
5.4.110.0130.02713.73
5.4.100.0180.02713.69
5.4.90.0200.02713.62
5.4.80.0170.02713.76
5.4.70.0070.03613.71
5.4.60.0100.03713.68
5.4.50.0150.02813.70
5.4.40.0100.03213.69
5.4.30.0130.02813.58
5.4.20.0120.03113.61
5.4.10.0160.02713.55
5.4.00.0130.03813.50
5.3.290.0200.08014.84
5.3.280.0230.05714.73
5.3.270.0200.06014.82
5.3.260.0300.04714.73
5.3.250.0170.06714.67
5.3.240.0330.04314.82
5.3.230.0170.06014.83
5.3.220.0370.04014.70
5.3.210.0230.05714.56
5.3.200.0300.04714.80
5.3.190.0230.06014.79
5.3.180.0230.05014.60
5.3.170.0270.05014.79
5.3.160.0100.06314.59
5.3.150.0300.04714.57
5.3.140.0330.04014.60
5.3.130.0200.08014.78
5.3.120.0170.06014.66
5.3.110.0230.05714.76
5.3.100.0200.05714.14
5.3.90.0270.05014.01
5.3.80.0200.05714.01
5.3.70.0200.05714.16
5.3.60.0270.04714.03
5.3.50.0200.05014.09
5.3.40.0270.04714.02
5.3.30.0230.05014.02
5.3.20.0230.05313.82
5.3.10.0170.05313.73
5.3.00.0170.06013.64
5.2.170.0230.04011.28
5.2.160.0270.05011.18
5.2.150.0200.06011.26
5.2.140.0200.04311.21
5.2.130.0270.05011.25
5.2.120.0170.06011.21
5.2.110.0170.04311.13
5.2.100.0170.04311.32
5.2.90.0130.04711.15
5.2.80.0170.04311.12
5.2.70.0230.04011.14
5.2.60.0170.05311.19
5.2.50.0270.05011.24
5.2.40.0400.05011.02
5.2.30.0230.04311.09
5.2.20.0330.03711.02
5.2.10.0200.04711.07
5.2.00.0170.04010.83
5.1.60.0130.03710.02
5.1.50.0200.03310.13
5.1.40.0170.03310.01
5.1.30.0170.05010.42
5.1.20.0230.03710.57
5.1.10.0170.04310.11
5.1.00.0200.03310.20
5.0.50.0030.0378.75
5.0.40.0100.0378.43
5.0.30.0100.0508.41
5.0.20.0130.0338.39
5.0.10.0230.0308.21
5.0.00.0070.0578.19
4.4.90.0100.0277.55
4.4.80.0130.0237.55
4.4.70.0100.0277.55
4.4.60.0170.0207.55
4.4.50.0100.0207.55
4.4.40.0100.0337.55
4.4.30.0030.0277.55
4.4.20.0030.0277.55
4.4.10.0070.0237.55
4.4.00.0100.0337.55
4.3.110.0130.0277.55
4.3.100.0030.0277.55
4.3.90.0070.0237.55
4.3.80.0130.0407.55
4.3.70.0070.0277.55
4.3.60.0030.0237.55
4.3.50.0100.0207.55
4.3.40.0100.0307.55
4.3.30.0000.0277.55
4.3.20.0070.0207.55
4.3.10.0030.0237.55
4.3.00.0030.0307.56

preferences:
42.76 ms | 401 KiB | 5 Q