3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* https://core.trac.wordpress.org/ticket/22952 gzencode() == gzip gzcompress() == zlib (aka. HTTP deflate) gzdeflate() == *raw* deflate encoding */ function _run_function($compress_f, $uncompress_f, $s_orig, $encoding_name) { global $compression_level; $compressed = $compress_f($s_orig, $compression_level, constant($encoding_name)); if ($compressed === false) { echo "FAIL $compress_f with encoding=$encoding_name". PHP_EOL; return false; } if ($s_orig !== $uncompress_f($compressed)) { echo "FAIL $uncompress_f after $compress_f with encoding=$encoding_name". PHP_EOL; return false; } echo "PASS $compress_f/$uncompress_f with encoding=$encoding_name". PHP_EOL; return true; } $compression_level = 6; // default level is 6 echo '=========== LATIN STRING ===========' . PHP_EOL; $str = '!@#$%^&*()QWERTYUIOPSDFGHJKL!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNMa!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPD:ZXCVBNM#!@#!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNM-!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPD$%^&*()ERTYUIODFGHJ!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNM]!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPDKLXCVBNM@#$%^&*()RTYUIOPDFGHJKLCVBNMFGHJTYU%^&RFGHJ4d56g7h8ui7h8ujirqwerqh8'; _run_function('gzencode', 'gzdecode', $str, 'FORCE_GZIP'); _run_function('gzencode', 'gzdecode', $str, 'FORCE_DEFLATE'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_DEFLATE'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_GZIP'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_RAW'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_DEFLATE'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_GZIP'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_RAW'); echo '=========== NON-LATIN STRING ===========' . PHP_EOL; $str = '布局 1 介绍 布局,简单来说就是设置元素的大小和位置。 Ext 的布局系统包括组件,布局,容器,容器是一种特殊的组件,可以管理组件的大小和位置。 容器是通过 doLayout 来重新计算布局,并更新 DOM. 2 手工布局是不必要的,框架会为你自动处理。'; _run_function('gzencode', 'gzdecode', $str, 'FORCE_GZIP'); _run_function('gzencode', 'gzdecode', $str, 'FORCE_DEFLATE'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_DEFLATE'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_GZIP'); _run_function('gzcompress', 'gzuncompress', $str, 'ZLIB_ENCODING_RAW'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_DEFLATE'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_GZIP'); _run_function('gzdeflate', 'gzinflate', $str, 'ZLIB_ENCODING_RAW');

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)
8.3.60.0120.00918.45
8.3.50.0040.01119.77
8.3.40.0150.00019.10
8.3.30.0040.01218.95
8.3.20.0110.00721.99
8.3.10.0060.00320.46
8.3.00.0050.00320.79
8.2.180.0060.00917.00
8.2.170.0100.00619.34
8.2.160.0070.00722.96
8.2.150.0030.00525.66
8.2.140.0060.00324.66
8.2.130.0060.00919.59
8.2.120.0040.00426.35
8.2.110.0040.00820.68
8.2.100.0030.01017.97
8.2.90.0090.00018.09
8.2.80.0030.00719.36
8.2.70.0060.00317.75
8.2.60.0000.00918.29
8.2.50.0090.00618.79
8.2.40.0110.00318.90
8.2.30.0100.00318.86
8.2.20.0100.00318.87
8.2.10.0050.00718.97
8.2.00.0080.00619.04
8.1.280.0130.00925.92
8.1.270.0030.00622.39
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0060.00322.54
8.1.230.0090.00321.13
8.1.220.0000.01018.03
8.1.210.0030.00519.13
8.1.200.0060.00317.60
8.1.190.0030.00617.48
8.1.180.0110.00118.81
8.1.170.0070.00619.20
8.1.160.0030.01119.33
8.1.150.0120.00219.33
8.1.140.0080.00519.67
8.1.130.0050.00819.42
8.1.120.0060.00618.65
8.1.110.0120.00118.56
8.1.100.0040.00818.62
8.1.90.0110.00218.56
8.1.80.0060.00518.59
8.1.70.0080.00418.59
8.1.60.0100.00418.68
8.1.50.0100.00618.67
8.1.40.0060.00818.65
8.1.30.0060.00718.63
8.1.20.0120.00218.72
8.1.10.0120.00118.67
8.1.00.0020.01118.63
8.0.300.0000.00820.23
8.0.290.0050.00317.13
8.0.280.0120.00019.13
8.0.270.0100.00218.32
8.0.260.0040.00819.10
8.0.250.0070.00518.40
8.0.240.0100.00318.39
8.0.230.0070.00618.40
8.0.220.0090.00418.34
8.0.210.0070.00518.31
8.0.200.0070.00618.36
8.0.190.0040.00918.34
8.0.180.0110.00218.32
8.0.170.0110.00118.37
8.0.160.0050.00818.37
8.0.150.0090.00418.31
8.0.140.0110.00218.36
8.0.130.0070.00616.61
8.0.120.0060.00618.29
8.0.110.0080.00418.34
8.0.100.0100.00318.37
8.0.90.0070.00417.95
8.0.80.0080.00717.97
8.0.70.0110.00117.97
8.0.60.0090.00217.92
8.0.50.0070.00417.99
8.0.30.0150.00517.59
8.0.20.0100.01017.69
8.0.10.0150.00418.00
8.0.00.0090.00717.85
7.4.330.0070.00317.53
7.4.320.0060.00618.11
7.4.300.0070.00418.12
7.4.290.0120.00118.12
7.4.280.0050.00718.11
7.4.270.0090.00318.14
7.4.260.0050.00718.07
7.4.250.0100.00418.19
7.4.240.0080.00418.18
7.4.230.0120.00018.13
7.4.220.0110.00717.67
7.4.210.0060.00917.40
7.4.200.0070.00317.62
7.4.190.0070.00518.23
7.4.180.0080.00418.22
7.4.160.0090.00917.33
7.4.150.0120.00917.62
7.4.140.0120.00917.71
7.4.130.0100.01017.23
7.4.120.0090.01117.26
7.4.110.0090.01217.43
7.4.100.0140.00717.35
7.4.90.0120.00517.38
7.4.80.0080.00818.14
7.4.70.0110.00717.35
7.4.60.0100.00717.42
7.4.50.0110.00517.33
7.4.40.0070.00917.29
7.4.30.0110.00617.47
7.4.20.0070.01217.27
7.4.10.0100.00916.95
7.4.00.0070.01016.68
7.3.330.0060.00516.46
7.3.320.0050.00716.53
7.3.310.0080.00418.03
7.3.300.0080.00318.05
7.3.290.0030.00717.55
7.3.280.0100.00616.85
7.3.270.0090.00817.50
7.3.260.0130.00717.22
7.3.250.0110.00717.12
7.3.240.0120.00717.17
7.3.230.0090.00817.36
7.3.220.0060.01117.52
7.3.210.0130.00517.35
7.3.200.0130.00417.30
7.3.190.0080.01117.33
7.3.180.0110.00617.29
7.3.170.0090.00817.32
7.3.160.0090.00917.32
7.3.150.0110.00517.56
7.3.140.0100.00717.54
7.3.130.0100.00916.77
7.3.120.0140.00616.78
7.3.110.0100.01016.71
7.3.100.0090.00916.74
7.3.90.0080.00916.90
7.3.80.0090.00916.79
7.3.70.0100.00716.78
7.3.60.0120.00516.77
7.3.50.0080.01016.82
7.3.40.0080.00916.73
7.3.30.0090.00816.78
7.3.20.0100.00717.54
7.3.10.0110.00817.47
7.3.00.0110.00817.51
7.2.340.0120.00817.56
7.2.330.0120.00617.38
7.2.320.0120.00517.33
7.2.310.0080.00917.38
7.2.300.0140.00617.32
7.2.290.0120.00517.39
7.2.280.0090.00917.56
7.2.270.0110.00717.58
7.2.260.0100.01016.84
7.2.250.0130.01016.97
7.2.240.0110.00816.96
7.2.230.0130.00716.87
7.2.220.0120.00916.85
7.2.210.0120.00716.88
7.2.200.0090.00816.94
7.2.190.0100.00816.92
7.2.180.0090.00816.86
7.2.170.0110.00816.89
7.2.160.0090.00916.91
7.2.150.0080.01017.74
7.2.140.0120.00617.62
7.2.130.0080.00917.66
7.2.120.0080.00917.68
7.2.110.0100.00917.69
7.2.100.0100.00817.69
7.2.90.0120.00617.61
7.2.80.0090.00817.66
7.2.70.0120.00717.60
7.2.60.0080.00917.61
7.2.50.0120.00917.66
7.2.40.0100.00917.70
7.2.30.0100.01017.70
7.2.20.0100.00917.66
7.2.10.0100.01017.74
7.2.00.0140.00817.70
7.1.330.0110.00616.81
7.1.320.0120.00616.82
7.1.310.0090.00716.73
7.1.300.0070.00916.82
7.1.290.0080.00816.79
7.1.280.0100.00816.73
7.1.270.0050.01116.77
7.1.260.0080.00716.76
7.1.250.0100.00716.73
7.1.240.0090.00816.76
7.1.230.0110.00716.78
7.1.220.0110.00816.69
7.1.210.0100.00816.72
7.1.200.0110.00716.54
7.1.190.0140.00516.74
7.1.180.0100.00916.72
7.1.170.0100.00816.76
7.1.160.0120.00716.67
7.1.150.0100.01016.69
7.1.140.0110.01016.74
7.1.130.0140.00816.78
7.1.120.0130.00616.75
7.1.110.0110.00816.68
7.1.100.0130.00716.72
7.1.90.0130.00916.69
7.1.80.0200.00716.65
7.1.70.0110.00816.58
7.1.60.0120.00918.88
7.1.50.0140.00918.86
7.1.40.0130.00818.84
7.1.30.0180.00518.79
7.1.20.0100.01118.80
7.1.10.0140.00416.58
7.1.00.0120.00816.53
7.0.330.0130.00616.47
7.0.320.0120.00816.39
7.0.310.0080.00916.38
7.0.300.0120.00416.33
7.0.290.0090.00716.38
7.0.280.0070.01016.43
7.0.270.0080.01016.44
7.0.260.0100.00916.49
7.0.250.0140.00616.47
7.0.240.0110.00916.48
7.0.230.0120.00616.40
7.0.220.0080.01016.46
7.0.210.0100.00816.28
7.0.200.0080.01116.35
7.0.190.0110.00816.31
7.0.180.0110.00716.25
7.0.170.0110.00616.28
7.0.160.0110.00816.32
7.0.150.0110.00916.22
7.0.140.0090.00916.29
7.0.130.0110.00816.26
7.0.120.0130.00616.34
7.0.110.0100.01016.26
7.0.100.0100.00916.29
7.0.90.0100.01016.27
7.0.80.0110.00916.26
7.0.70.0080.01016.23
7.0.60.0180.00516.23
7.0.50.0110.00916.22
7.0.40.0110.00615.78
7.0.30.0140.00415.79
7.0.20.0130.00715.70
7.0.10.0150.00615.78
7.0.00.0140.00915.79
5.6.400.0090.00916.30
5.6.390.0080.01016.26
5.6.380.0090.01016.44
5.6.370.0110.00716.28
5.6.360.0090.01016.41
5.6.350.0090.01016.32
5.6.340.0110.00916.30
5.6.330.0110.00916.35
5.6.320.0110.00816.29
5.6.310.0120.00716.39
5.6.300.0100.00916.35
5.6.290.0110.00916.48
5.6.280.0110.00816.34
5.6.270.0130.00716.33
5.6.260.0060.01216.38
5.6.250.0110.00916.45
5.6.240.0080.01116.34
5.6.230.0120.00716.42
5.6.220.0110.01016.40
5.6.210.0110.01016.33
5.6.200.0130.00716.42
5.6.190.0110.00716.40
5.6.180.0130.00716.39
5.6.170.0090.01116.36
5.6.160.0110.00716.47
5.6.150.0130.00816.39
5.6.140.0110.01016.38
5.6.130.0120.00616.31
5.6.120.0110.00816.46
5.6.110.0100.00816.30
5.6.100.0120.00716.32
5.6.90.0120.00716.36
5.6.80.0090.01116.29
5.6.70.0110.00716.27
5.6.60.0110.00816.38
5.6.50.0090.01016.29
5.6.40.0130.00816.33
5.6.30.0140.00716.31
5.6.20.0130.00816.30
5.6.10.0080.00916.23
5.6.00.0090.01016.18

preferences:
54.51 ms | 400 KiB | 5 Q