3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str1 = '{"seq":1,"app_id":"567067343352427","app_ver":"26.0.0.10.86","build_num":"83827592","device_id":"28de00f9-64ff-466c-89bb-ca25b5896613","family_device_id":"28de00f9-64ff-466c-89bb-ca25b5896613","session_id":"f97c8348-b785-43b6-a318-3d0fa6a2a2b9","uid":"0","config_checksum":"41da2f124d3b089eab730386564c4361","config_version":"v2","channel":"regular","log_type":"client_event","data":[{"name":"ig_account_switched","time":"1521488145.589","extra":{"from_pk":"7149962663","to_pk":"1415622097","entry_point":"long_press_tab_bar","pk":"7149962663","release_channel":"beta","radio_type":"mobile-lte"}}]}'; $str2 = '{"seq":1,"app_id":"567067343352427","app_ver":"26.0.0.10.86","build_num":"83827592","device_id":"28de00f9-64ff-466c-89bb-ca25b5896613","family_device_id":"28de00f9-64ff-466c-89bb-ca25b5896613","session_id":"f97c8348-b785-43b6-a318-3d0fa6a2a2b9","uid":"0","config_checksum":"41da2f124d3b089eab730386564c4361","config_version":"v2","channel":"regular","log_type":"client_event","data":[{"name":"ig_account_switched","time":"1521488145.589","extra":{"from_pk":"7149962663","to_pk":"1415622097","entry_point":"long_press_tab_bar","pk":"7149962663","release_channel":"beta","radio_type":"mobile-lte"}}]}'; 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)
7.3.120.0030.06615.22
7.3.110.0000.07215.34
7.3.100.0000.08414.94
7.3.90.0070.06414.88
7.3.80.0070.06615.00
7.3.70.0070.06615.08
7.3.60.0100.06415.11
7.3.50.0030.06615.18
7.3.40.0070.06414.96
7.3.30.0070.06415.18
7.3.20.0100.06216.72
7.3.10.0090.07016.31
7.3.00.0100.07216.41
7.2.240.0070.06715.47
7.2.230.0130.06015.30
7.2.220.0100.06415.49
7.2.210.0000.07315.21
7.2.200.0100.06115.22
7.2.190.0100.06215.22
7.2.180.0070.07015.27
7.2.170.0030.06515.21
7.2.160.0030.06915.16
7.2.150.0100.06817.11
7.2.140.0130.06116.96
7.2.130.0100.06716.74
7.2.120.0110.06616.70
7.2.110.0100.06716.79
7.2.100.0100.07116.65
7.2.90.0120.06216.67
7.2.80.0130.06516.83
7.2.70.0180.06516.98
7.2.60.0050.07316.93
7.2.50.0160.06316.92
7.2.40.0120.06516.96
7.2.30.0140.07417.26
7.2.20.0110.07117.23
7.2.10.0080.07317.06
7.2.00.0120.07417.38
7.1.330.0100.06815.84
7.1.320.0030.06415.80
7.1.310.0030.06615.89
7.1.300.0030.07015.89
7.1.290.0030.06615.76
7.1.280.0100.05915.71
7.1.270.0130.06615.69
7.1.260.0030.06915.94
7.1.250.0100.06715.46
7.1.150.0110.07817.12
7.1.140.0100.08316.70
7.1.130.0120.09417.24
7.1.120.0140.08316.93
7.1.110.0100.12016.30
7.1.100.0100.08316.36
7.1.90.0140.07916.38
7.1.80.0120.07816.69
7.1.70.0190.07815.68
7.1.60.0240.07933.25
7.1.50.0290.08732.98
7.1.40.0350.10332.84
7.1.30.0930.08633.14
7.1.20.0280.08432.99
7.1.10.0100.07815.07
7.1.00.0060.08215.17

preferences:
52.84 ms | 759 KiB | 5 Q