3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MsgAry1 = ["A","B","C","D","E","F","G","H","I","J", "K","L","M","N","O","P","Q","R","S","T", "U","V","W","X","Y","Z","a","b","c","d", "e","f","g","h","i","j","k","l","m","n", "o","p","q","r","s","t","u","v","w","x", "y","z","1","2","3","4","5","6","7","8", "9","0",".",",","'","?","!"," ","_","-"]; $strings = [ 'test', '1234', 'w0ws3r!', '##tag##', "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _-" ]; foreach ($strings as $string) { echo "$string match: " . var_export(!preg_match('~[^\w.,\'?! -]~', $string), true) . "\n"; echo "$string ltrim: " . var_export(!strlen(ltrim($string, implode($MsgAry1))), true) . "\n"; echo "$string ranged ltrim, chars remaining: \"" . ltrim($string, 'A..Za..z0..9.,\'?! _-') . "\"\n---\n"; }

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.70.0070.01016.58
8.3.60.0070.01118.68
8.3.50.0100.01020.32
8.3.40.0160.00019.16
8.3.30.0110.00319.17
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0030.00626.16
8.2.180.0120.00625.92
8.2.170.0120.00322.96
8.2.160.0030.01022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00726.16
8.2.110.0090.00022.30
8.2.100.0100.00317.72
8.2.90.0030.00618.16
8.2.80.0040.00418.99
8.2.70.0000.00817.75
8.2.60.0110.00017.93
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0080.00017.96
8.2.20.0040.00420.46
8.2.10.0030.00518.07
8.2.00.0040.00419.30
8.1.280.0150.00325.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.88
8.1.230.0120.00019.09
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0040.00418.81
8.1.160.0080.00018.96
8.1.150.0000.00818.67
8.1.140.0040.00417.48
8.1.130.0030.00318.91
8.1.120.0080.00017.61
8.1.110.0040.00417.50
8.1.100.0040.00417.65
8.1.90.0000.00817.61
8.1.80.0000.00817.57
8.1.70.0030.00317.57
8.1.60.0060.00317.57
8.1.50.0000.00817.69
8.1.40.0030.00617.63
8.1.30.0090.00017.70
8.1.20.0000.01017.72
8.1.10.0070.00317.66
8.1.00.0040.00417.48
8.0.300.0070.00018.77
8.0.290.0040.00416.88
8.0.280.0040.00418.47
8.0.270.0080.00018.21
8.0.260.0080.00018.34
8.0.250.0040.00417.09
8.0.240.0000.00917.08
8.0.230.0000.00717.15
8.0.220.0000.00717.04
8.0.210.0090.00017.05
8.0.200.0000.00716.97
8.0.190.0040.00417.10
8.0.180.0040.00417.13
8.0.170.0090.00017.10
8.0.160.0040.00417.12
8.0.150.0030.00516.99
8.0.140.0040.00417.01
8.0.130.0040.00417.00
8.0.120.0030.00517.05
8.0.110.0040.00417.05
8.0.100.0000.00817.00
8.0.90.0030.00516.97
8.0.80.0040.00416.90
8.0.70.0080.00017.02
8.0.60.0060.00317.09
8.0.50.0000.00816.90
8.0.30.0040.00416.93
8.0.20.0040.00417.00
8.0.10.0090.00017.18
7.4.330.0000.00515.55
7.4.320.0030.00316.79
7.4.300.0000.00616.82
7.4.290.0000.00716.60
7.4.280.0000.00716.80
7.4.270.0050.00216.71
7.4.260.0040.00416.85
7.4.250.0000.00716.60
7.4.240.0060.00316.81
7.4.230.0040.00416.84
7.4.220.0040.00416.82
7.4.210.0040.00416.56
7.4.200.0040.00416.71
7.4.190.0000.00816.89
7.4.180.0070.00016.75
7.4.160.0040.00416.77
7.4.150.0050.00316.79
7.4.140.0000.00716.70
7.4.130.0080.00016.78
7.4.120.0000.00816.75
7.4.110.0040.00416.77
7.4.100.0000.00816.92
7.4.90.0080.00016.82
7.4.80.0040.00416.73
7.4.70.0080.00016.66
7.4.60.0080.00016.84
7.4.50.0080.00016.55
7.4.40.0000.00816.70
7.4.30.0030.00616.58
7.4.20.0110.00016.50
7.4.10.0040.00416.64
7.4.00.0070.00016.67

preferences:
56.72 ms | 401 KiB | 5 Q