3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = '布局 1 介绍 布局,简单来说就是设置元素的大小和位置。 Ext 的布局系统包括组件,布局,容器,容器是一种特殊的组件,可以管理组件的大小和位置。 容器是通过 doLayout 来重新计算布局,并更新 DOM. 2 手工布局是不必要的,框架会为你自动处理。'; $str2 = '!@#$%^&*()QWERTYUIOPSDFGHJKL!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNMa!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPD:ZXCVBNM#!@#!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNM-!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPD$%^&*()ERTYUIODFGHJ!@#$%^&*()QWERTYUIOPSDFGHJKL:ZXCVBNM]!@#$%^&*()ERTYUIODFGHJKLXCVBNM@#$%^&*()RTYUIOPDKLXCVBNM@#$%^&*()RTYUIOPDFGHJKLCVBNMFGHJTYU%^&RFGHJ4d56g7h8ui7h8ujirqwerqh8'; echo '<b>压缩中文比较</b>',PHP_EOL,PHP_EOL; compress_comp( $str1, 1000 ); // 压缩1000次 与 解压缩1000次比较 echo PHP_EOL; echo '<b>压缩英文数字比较</b>',PHP_EOL,PHP_EOL; compress_comp( $str2, 1000 ); // 压缩1000次 与 解压缩1000次比较 /* 压缩 */ function compress_comp( $str, $num ) { $func_compress = array( 'gzcompress', 'gzencode', 'gzdeflate', 'bzcompress' ); //echo '原文:' . $str ,PHP_EOL; echo '原文大小:' . strlen( $str ) ,PHP_EOL; for ( $i = 0, $length = count( $func_compress ); $i < $length; $i ++ ) { $starttime = get_microtime(); for ( $j = 0; $j < $num; $j ++ ) { $mstr = $func_compress[ $i ]( $str, 6 ); /*switch ( $func_compress[ $i ] ) { case 'gzcompress': $mstr = gzcompress( $str, 9 ); // 解压方法:gzuncompress break; case 'gzencode': $mstr = gzencode( $str, 9 ); // 解压方法:gzdecode php>=5.4 break; case 'gzdeflate': $mstr = gzdeflate( $str, 9 ); // 解压方法:gzinflate break; case 'bzcompress': $mstr = bzcompress( $str, 9 ); // 解压方法:bzdecompress break; }*/ } $endtime = get_microtime(); echo $func_compress[ $i ] . ' 压缩后大小:' . strlen( $mstr ) . ' 耗时:' . ($endtime - $starttime ) . 'ms',PHP_EOL; } } /* 获取 microtime */ function get_microtime() { return microtime( true ); }

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.0.00.0150.08416.96
7.4.130.0330.09316.80
7.4.120.0290.11316.70
7.4.110.0290.07716.69
7.4.100.0200.08016.68
7.4.90.0270.07516.73
7.4.80.0430.06316.63
7.4.70.0170.07816.61
7.4.60.0210.09616.59
7.4.50.0200.09316.67
7.4.40.0160.07616.64
7.4.30.0130.08016.65
7.4.20.0170.11616.68
7.4.10.0160.07616.61
7.4.00.0120.09016.70
7.3.250.0150.07016.63
7.3.240.0370.11316.80
7.3.230.0070.08916.48
7.3.220.0230.07516.70
7.3.210.0260.08416.75
7.3.200.0240.07816.78
7.3.190.0230.07316.55
7.3.180.0210.09016.61
7.3.170.0260.09516.61
7.3.160.0170.07416.59
7.3.150.0180.08416.69
7.3.140.0170.07616.52
7.3.130.0140.07316.48
7.3.120.0150.07616.66
7.3.110.0130.07416.45
7.3.100.0200.07916.50
7.3.90.0140.08016.70
7.3.80.0190.07416.78
7.3.70.0250.06816.53
7.3.60.0160.07916.61
7.3.50.0150.10016.62
7.3.40.0160.08016.57
7.3.30.0130.08316.55
7.3.20.0150.08016.67
7.3.10.0240.08116.66
7.3.00.0160.09216.73
7.2.340.0120.08616.84
7.2.330.0170.11017.00
7.2.320.0030.07816.72
7.2.310.0050.10316.73
7.2.300.0180.08616.66
7.2.290.0110.09316.88
7.2.280.0130.07416.73
7.2.270.0140.07416.81
7.2.260.0110.08316.83
7.2.250.0130.07716.94
7.2.240.0150.08016.82
7.2.230.0150.09216.81
7.2.220.0160.07816.72
7.2.210.0210.11016.81
7.2.200.0150.08316.78
7.2.190.0070.08616.80
7.2.180.0180.07316.74
7.2.170.0160.10616.74
7.2.160.0150.09516.87
7.2.150.0130.09616.72
7.2.140.0100.08216.79
7.2.130.0150.09316.82
7.2.120.0140.08116.60
7.2.110.0160.07516.83
7.2.100.0100.08116.70
7.2.90.0180.07716.79
7.2.80.0180.07316.84
7.2.70.0170.09716.80
7.2.60.0120.07816.76
7.2.50.0120.08916.69
7.2.40.0170.08816.70
7.2.30.0170.09416.84
7.2.20.0100.09816.82
7.2.10.0140.07816.80
7.2.00.0170.09516.83
7.1.330.0330.07415.77
7.1.320.0990.08215.78
7.1.310.0300.09415.85
7.1.300.0170.10215.82
7.1.290.0200.10415.74
7.1.280.0240.08615.72
7.1.270.0230.09515.93
7.1.260.0150.10015.75
7.1.250.0260.07015.92
7.1.240.0180.08015.72
7.1.230.0190.07515.62
7.1.220.0150.09715.54
7.1.210.1240.07015.62
7.1.200.0230.07315.68
7.1.190.0190.07215.63
7.1.180.0510.07915.77
7.1.170.0140.10015.60
7.1.160.0210.08115.72
7.1.150.0170.07915.73
7.1.140.0290.08515.61
7.1.130.0190.07915.55
7.1.120.0180.09115.52
7.1.110.0150.08715.67
7.1.100.0150.07715.75
7.1.90.0250.08815.83
7.1.80.0190.08715.66
7.1.70.0300.07915.78
7.1.60.0350.07615.72
7.1.50.0410.06415.77
7.1.40.0280.06915.78
7.1.30.0330.07115.72
7.1.20.0640.06615.75
7.1.10.0310.07115.77
7.1.00.0350.06715.65
7.0.330.0170.09615.43
7.0.320.1170.08315.33
7.0.310.0260.09315.33
7.0.300.0160.08215.38
7.0.290.0210.09515.36
7.0.280.0290.08315.39
7.0.270.0240.08315.33
7.0.260.0210.09415.36
7.0.250.0210.07215.26
7.0.240.0230.09215.28
7.0.230.0200.07115.26
7.0.220.0210.09415.32
7.0.210.0190.07715.39
7.0.200.0300.07615.58
7.0.190.0400.06715.60
7.0.180.0380.08215.52
7.0.170.0320.07215.58
7.0.160.0360.08315.58
7.0.150.0330.08615.58
7.0.140.0430.08215.55
7.0.130.0300.09715.59
7.0.120.0330.08615.62
7.0.110.0360.07315.58
7.0.100.0310.07115.60
7.0.90.0330.06815.60
7.0.80.0510.08115.51
7.0.70.0380.06615.50
7.0.60.0360.08015.59
7.0.50.0340.07115.54
7.0.40.0200.07215.49
7.0.30.0170.07915.55
7.0.20.0110.07415.49
7.0.10.0210.08715.52
7.0.00.0190.07515.50
5.6.400.0320.08515.97
5.6.390.0510.08316.39
5.6.380.0410.08216.25
5.6.370.0320.08716.02
5.6.360.0380.09116.23
5.6.350.0430.12216.36
5.6.340.0360.10316.38
5.6.330.0430.09316.20
5.6.320.0260.09016.20
5.6.310.0320.08516.29
5.6.300.0300.10018.00
5.6.290.0310.11217.81
5.6.280.0240.09017.89
5.6.270.0440.09418.04
5.6.260.0250.08917.88
5.6.250.0340.10517.92
5.6.240.0290.08818.04
5.6.230.0350.10018.01
5.6.220.0290.08817.84
5.6.210.0270.09317.92
5.6.200.0330.09618.05
5.6.190.0370.11017.83
5.6.180.0360.10217.76
5.6.170.0340.10417.88
5.6.160.0230.09717.92
5.6.150.0360.10317.93
5.6.140.0380.11317.83
5.6.130.0270.09617.85
5.6.120.0250.09517.87
5.6.110.0200.09517.90
5.6.100.0280.09617.92
5.6.90.0340.08717.81
5.6.80.0320.09117.58
5.6.70.0300.09817.54
5.6.60.0240.08517.70
5.6.50.0240.11217.58
5.6.40.0260.08917.59
5.6.30.0310.09317.57
5.6.20.0320.08617.67
5.6.10.0290.11017.70
5.6.00.0270.11117.54
5.5.380.0260.09116.70
5.5.370.0350.08916.89
5.5.360.0290.09116.90
5.5.350.0330.08616.73
5.5.340.0370.08816.96
5.5.330.0320.10516.76
5.5.320.0470.09716.84
5.5.310.0320.09516.89
5.5.300.0360.09716.85
5.5.290.0220.11017.00
5.5.280.0230.10516.96
5.5.270.0280.09617.04
5.5.260.0370.09317.07
5.5.250.0280.09016.87
5.5.240.0370.09316.62
5.5.230.0340.10316.73
5.5.220.0240.11316.59
5.5.210.0230.09216.77
5.5.200.0260.08616.66
5.5.190.0340.08916.61
5.5.180.0210.10616.75
5.5.170.0350.09816.15
5.5.160.0240.10216.67
5.5.150.0240.09616.57
5.5.140.0310.09016.77
5.5.130.0250.09516.67
5.5.120.0300.11616.58
5.5.110.0270.09416.59
5.5.100.0250.10516.38
5.5.90.0240.09116.52
5.5.80.0260.08616.54
5.5.70.0280.08616.56
5.5.60.0230.08416.67
5.5.50.0270.08216.43
5.5.40.0250.10416.63
5.5.30.0270.08916.60
5.5.20.0330.08016.67
5.5.10.0340.08716.64
5.5.00.0240.09816.58
5.4.450.0240.09215.91
5.4.440.0250.10215.80
5.4.430.0320.10515.88
5.4.420.0280.08615.85
5.4.410.0260.09515.86
5.4.400.0260.09615.84
5.4.390.0280.09415.67
5.4.380.0240.09215.76
5.4.370.0310.09715.73
5.4.360.0290.09115.90
5.4.350.0290.10015.72
5.4.340.0300.09315.77
5.4.330.0340.08913.96
5.4.320.0350.10415.78
5.4.310.0270.08715.82
5.4.300.0260.09115.76
5.4.290.0250.09015.75
5.4.280.0270.09415.77
5.4.270.0190.09215.71
5.4.260.0260.08815.67
5.4.250.0320.09115.79
5.4.240.0310.09315.66
5.4.230.0250.08415.64
5.4.220.0260.08315.78
5.4.210.0220.08515.68
5.4.200.0230.08815.72
5.4.190.0330.08615.66
5.4.180.0170.10615.72
5.4.170.0280.08615.75
5.4.160.0220.10115.67
5.4.150.0270.09515.72
5.4.140.0250.08014.99
5.4.130.0240.07714.93
5.4.120.0350.08914.95
5.4.110.0260.09414.97
5.4.100.0340.10614.92
5.4.90.0260.08114.89
5.4.80.0270.10314.93
5.4.70.0280.08314.87
5.4.60.0260.09314.84
5.4.50.0200.09414.83
5.4.40.0390.08315.00
5.4.30.0350.08214.97
5.4.20.0250.08814.83
5.4.10.0260.08714.81
5.4.00.0280.09814.69