3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'this is a test sentence'; $max = 12; var_export( preg_replace( "/.{0,$max}\K .*/", '', $text ) );

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.4.130.0050.00617.66
8.4.120.0110.00920.43
8.4.110.0100.00923.76
8.4.100.0040.00517.77
8.4.90.0090.01117.88
8.4.80.0060.00222.22
8.4.70.0050.00317.88
8.4.60.0050.00419.76
8.4.50.0120.00720.38
8.4.40.0070.01417.71
8.4.30.0130.00718.68
8.4.20.0080.00819.84
8.4.10.0130.01019.57
8.3.260.0120.00916.55
8.3.250.0120.00718.69
8.3.240.0120.00717.27
8.3.230.0110.00916.66
8.3.220.0110.00717.20
8.3.210.0100.00916.78
8.3.200.0110.00816.68
8.3.190.0060.00616.93
8.3.180.0060.00418.92
8.3.170.0110.00716.60
8.3.160.0100.01016.47
8.3.150.0130.00717.07
8.3.140.0070.00716.62
8.3.130.0080.00016.79
8.3.120.0030.00618.88
8.3.110.0000.01620.94
8.3.100.0230.00730.58
8.3.90.0410.00726.77
8.3.80.0460.00626.77
8.3.70.0440.00526.77
8.3.60.0390.00726.77
8.3.50.0470.00326.77
8.3.40.0270.00426.77
8.3.30.0320.00826.77
8.3.20.0310.00926.77
8.3.10.0340.00726.77
8.3.00.0350.00626.77
8.2.290.0080.01220.57
8.2.280.0100.00916.57
8.2.270.0060.01216.79
8.2.260.0070.00717.00
8.2.250.0060.00318.62
8.2.240.0120.00318.87
8.2.230.0040.00422.58
8.2.220.0080.00024.06
8.2.210.0290.01126.77
8.2.200.0330.00826.77
8.2.190.0390.00326.77
8.2.180.0280.01226.77
8.2.170.0400.00726.77
8.2.160.0420.00326.77
8.2.150.0350.00626.77
8.2.140.0300.01026.77
8.2.130.0230.00926.77
8.2.120.0250.01126.77
8.2.110.0410.00326.77
8.2.100.0430.00026.77
8.2.90.0470.00026.77
8.2.80.0350.00826.77
8.2.70.0350.01026.77
8.2.60.0360.00726.77
8.2.50.0390.00326.77
8.2.40.0310.00926.77
8.2.30.0320.00726.77
8.2.20.0410.00026.77
8.2.10.0290.01226.77
8.2.00.0330.00726.77
8.1.330.0110.00821.99
8.1.320.0120.00816.03
8.1.310.0040.01116.68
8.1.300.0070.00416.20
8.1.290.0270.01626.77
8.1.280.0320.01026.77
8.1.270.0280.00026.77
8.1.260.0170.00326.77
8.1.250.0240.02026.77
8.1.240.0330.00426.77
8.1.230.0370.00726.77
8.1.220.0250.01326.77
8.1.210.0350.00426.77
8.1.200.0240.01426.77
8.1.190.0270.01226.77
8.1.180.0270.01126.77
8.1.170.0190.01926.77
8.1.160.0320.00626.77
8.1.150.0340.00026.77
8.1.140.0310.00026.77
8.1.130.0280.01126.77
8.1.120.0280.01126.77
8.1.110.0310.00726.77
8.1.100.0300.00826.77
8.1.90.0290.01126.77
8.1.80.0350.00426.77
8.1.70.0360.00626.77
8.1.60.0330.01026.77
8.1.50.0310.01126.77
8.1.40.0340.00826.77
8.1.30.0280.01426.77
8.1.20.0300.00926.77
8.1.10.0260.00026.77
8.1.00.0160.00326.77

preferences:
17.17 ms | 403 KiB | 5 Q