3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php echo _cbt_webform_crop_str('sdg sdfg sgd',3); function _cbt_webform_crop_str($string, $limit) { if (strlen($string) >= $limit) { $substring_limited = substr($string, 0, $limit); return substr($substring_limited, 0, strrpos($substring_limited,' ')); } else { //Если количество символов строки меньше чем задано, то просто возращаем оригинал return $string; } }

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)
5.4.140.0190.05412.04
5.4.130.0230.03714.19
5.4.120.0220.06611.99
5.4.110.0250.06311.98
5.4.100.0270.06111.98
5.4.90.0250.06411.98
5.4.80.0300.07211.98
5.4.70.0250.06211.98
5.4.60.0140.04311.98
5.4.50.0200.06711.98
5.4.40.0140.04411.97
5.4.30.0150.04311.96
5.4.20.0290.07311.96
5.4.10.0150.04311.96
5.4.00.0120.04311.46
5.3.240.0130.04612.72
5.3.230.0180.04213.62
5.3.220.0200.05712.68
5.3.210.0150.04512.68
5.3.200.0260.06312.68
5.3.190.0150.04512.68
5.3.180.0150.04512.67
5.3.170.0160.04512.67
5.3.160.0170.04412.67
5.3.150.0150.04512.68
5.3.140.0190.04112.66
5.3.130.0170.04312.66
5.3.120.0140.04912.66
5.3.110.0190.04212.66
5.3.100.0150.04512.12
5.3.90.0160.04212.08
5.3.80.0150.04512.07
5.3.70.0190.04112.08
5.3.60.0150.04512.06
5.3.50.0140.04512.00
5.3.40.0230.05012.00
5.3.30.0160.04011.94
5.3.20.0130.04411.72
5.3.10.0160.03911.67
5.3.00.0150.04211.66

preferences:
139.79 ms | 1394 KiB | 7 Q