3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["post: 746", "post: 2", "post: 84"]; var_export(array_map(function($v){return filter_var($v, FILTER_SANITIZE_NUMBER_INT);}, $array)); // remove all non-integer characters var_export(preg_replace('~^post: ~', '', $array, 1)); // only necessary if you have non-"post: " substrings var_export(array_map(function($v){return trim($v, ': opst');}, $array)); // I shuffled the character mask to prove order doesn't matter

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.5.10.0100.00816.86
8.5.00.0090.01120.13
8.4.150.0030.00014.05
8.4.140.0130.00817.56
8.4.130.0060.00518.65
8.4.120.0080.00824.29
8.4.110.0080.00518.82
8.4.100.0150.00617.86
8.4.90.0110.01018.40
8.4.80.0140.00718.00
8.4.70.0120.00917.80
8.4.60.0100.01120.09
8.4.50.0090.01119.68
8.4.40.0070.00417.88
8.4.30.0190.00319.38
8.4.20.0100.01020.50
8.4.10.0070.00719.87
8.3.280.0130.00718.25
8.3.270.0100.00916.59
8.3.260.0150.00616.85
8.3.250.0110.00718.88
8.3.240.0070.01116.91
8.3.230.0070.00516.62
8.3.220.0060.00217.04
8.3.210.0040.00419.02
8.3.200.0060.00216.93
8.3.190.0100.00917.26
8.3.180.0050.00216.70
8.3.170.0160.00319.04
8.3.160.0150.00316.84
8.3.150.0070.01120.68
8.3.140.0040.00416.85
8.3.130.0080.00816.59
8.3.120.0100.00020.97
8.3.110.0060.00318.49
8.3.100.0030.00618.28
8.3.90.0080.00026.77
8.3.80.0040.00416.75
8.3.70.0090.00916.58
8.3.60.0120.00318.29
8.3.50.0080.00818.32
8.3.40.0150.00618.70
8.3.30.0090.00618.85
8.3.20.0060.00318.77
8.3.10.0040.00423.52
8.3.00.0050.00320.95
8.2.290.0080.01120.18
8.2.280.0120.00820.64
8.2.270.0110.00717.02
8.2.260.0080.00018.82
8.2.250.0000.00816.91
8.2.240.0180.00018.97
8.2.230.0100.00020.94
8.2.220.0200.00024.06
8.2.210.0150.00426.77
8.2.200.0030.00618.41
8.2.190.0060.01216.88
8.2.180.0070.01425.92
8.2.170.0140.00419.08
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0040.00421.12
8.2.110.0030.00621.18
8.2.100.0040.00818.03
8.2.90.0050.00319.28
8.2.80.0000.00817.97
8.2.70.0080.00017.80
8.2.60.0050.00318.22
8.2.50.0000.00818.10
8.2.40.0030.01019.41
8.2.30.0030.00519.33
8.2.20.0040.00417.93
8.2.10.0000.00718.06
8.2.00.0000.00919.34
8.1.330.0100.00922.02
8.1.320.0060.00316.53
8.1.310.0090.00916.32
8.1.300.0040.00818.29
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0080.00023.87
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.93
8.1.230.0070.00420.94
8.1.220.0030.00617.77
8.1.210.0000.00818.81
8.1.200.0000.00817.48
8.1.190.0050.00317.50
8.1.180.0060.00318.10
8.1.170.0040.00418.71
8.1.160.0040.00418.78
8.1.150.0040.00418.79
8.1.140.0000.00722.07
8.1.130.0070.00020.16
8.1.120.0070.00017.61
8.1.110.0100.00017.66
8.1.100.0040.00417.63
8.1.90.0000.00717.64
8.1.80.0000.00817.65
8.1.70.0070.00017.59
8.1.60.0030.00617.70
8.1.50.0060.00317.59
8.1.40.0020.00517.67
8.1.30.0080.00017.81
8.1.20.0040.00417.70
8.1.10.0050.00317.48
8.1.00.0020.00517.54
8.0.300.0040.00420.01
8.0.290.0040.00416.75
8.0.280.0040.00418.25
8.0.270.0000.00717.10
8.0.260.0000.00818.31
8.0.250.0040.00416.90
8.0.240.0030.00316.98
8.0.230.0070.00016.89
8.0.220.0070.00016.99
8.0.210.0000.00816.97
8.0.200.0040.00417.07
8.0.190.0080.00016.96
8.0.180.0070.00017.06
8.0.170.0060.00316.94
8.0.160.0030.00317.11
8.0.150.0000.00716.88
8.0.140.0040.00416.98
8.0.130.0060.00013.47
8.0.120.0040.00416.87
8.0.110.0000.00717.13
8.0.100.0030.00517.14
8.0.90.0040.00417.05
8.0.80.0060.01017.00
8.0.70.0020.00516.93
8.0.60.0050.00216.84
8.0.50.0040.00417.02
8.0.30.0130.00517.29
8.0.20.0110.01017.40
8.0.10.0040.00417.19
8.0.00.0110.00616.78
7.4.330.0020.00215.55
7.4.320.0060.00316.69
7.4.300.0030.00316.71
7.4.290.0030.00316.55
7.4.280.0030.00516.60
7.4.270.0040.00716.81
7.4.260.0070.00016.70
7.4.250.0000.00816.67
7.4.240.0000.00716.61
7.4.230.0030.00316.61
7.4.220.0050.00216.83
7.4.210.0060.00916.78
7.4.200.0070.00016.60
7.4.160.0110.00816.58
7.4.140.0100.01017.86
7.4.130.0030.01416.86
7.4.120.0090.00916.67
7.4.110.0130.00616.60
7.4.100.0030.01616.66
7.4.90.0070.01816.46
7.4.80.0060.01219.39
7.4.70.0100.00716.65
7.4.60.0090.00616.64
7.4.50.0040.00816.72
7.4.40.0030.01316.58
7.4.00.0120.00414.93
7.3.330.0030.00313.34
7.3.320.0060.00013.31
7.3.310.0030.00316.24
7.3.300.0080.00016.39
7.3.290.0000.00916.39
7.3.280.0060.01016.37
7.3.260.0060.01116.45
7.3.240.0100.00816.48
7.3.230.0100.00616.36
7.3.210.0040.01216.67
7.3.200.0030.01316.61
7.3.190.0070.01016.42
7.3.180.0080.00816.56
7.3.170.0120.00316.40
7.3.160.0130.00716.80
7.2.330.0100.00716.68
7.2.320.0140.00716.73
7.2.310.0160.00916.77
7.2.300.0130.00316.66
7.2.290.0060.01216.62
7.2.120.0250.00714.77
7.2.110.0310.00314.60
7.2.100.0330.00314.91
7.2.90.0330.00614.89
7.2.80.0190.01014.63
7.2.70.0170.01015.04
7.2.60.0190.01015.20
7.2.50.0420.00014.90
7.2.40.0230.01014.97
7.2.30.0300.01215.24
7.2.20.0220.00515.20
7.2.10.0300.00314.92
7.2.00.0190.01115.21
7.1.240.0230.01013.93
7.1.230.0170.01014.01
7.1.220.0210.00313.96
7.1.210.0280.00313.99
7.1.200.0210.00914.10
7.1.190.0220.00614.04
7.1.180.0200.00714.08
7.1.170.0300.00714.11
7.1.160.0180.00913.99
7.1.150.0210.01013.99
7.1.140.0290.01414.05
7.1.130.0290.00314.05
7.1.120.0190.00713.95
7.1.110.0240.00314.10
7.1.100.0270.00314.16
7.1.90.0230.00813.91
7.1.80.0310.00314.13
7.1.70.0280.00613.88
7.1.60.0310.00614.10
7.1.50.0210.00913.85
7.1.40.0280.00613.99
7.1.30.0240.00613.90
7.1.20.0190.01014.08
7.1.10.0340.01013.70
7.1.00.0450.00714.00
5.6.380.0090.00614.59

preferences:
39.13 ms | 403 KiB | 5 Q