3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'this is a test! this is a test! this is a test! this is a test! this is a test! this is a test! cymk derp.png', ' this is a test! this is a test! this is a test! this is a test! this is a test! this is a test! cymk x.png ', ' this is a test! this is a test! this is a test! this is a test! this is a test! this is a test.png ', 'this is a test! this is a test! this is a test! this is a test! this is a test! this is a - - - - - - test.png', ]; foreach ( $tests as $originalFilename) { $filteredFilename = str_replace(' ', '-', strtolower(trim($originalFilename))); $filteredFilename = substr( $filteredFilename, 0, strrpos($filteredFilename,'.') ); $filteredFilename = str_replace('cmyk','',$filteredFilename); $filteredFilename = preg_replace('/(cmyk)|([^a-z0-9]+)|(\-+$)/','',$filteredFilename); $filteredFilename = preg_replace('/-{2,}/','-',$filteredFilename); if ( strlen($filteredFilename) > 80 ) { if ($filteredFilename[81] === '-') { $filteredFilename = substr($filteredFilename, 0, 80); } else { echo strrpos($filteredFilename, '-', 80); $filteredFilename = substr($filteredFilename, 0, 80); } } echo $filteredFilename; }

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.60.0150.00016.75
8.3.50.0150.00318.14
8.3.40.0090.00618.73
8.3.30.0090.00618.88
8.3.20.0050.00321.91
8.3.10.0050.00323.66
8.3.00.0040.00419.85
8.2.180.0090.00916.75
8.2.170.0140.00322.96
8.2.160.0100.00720.56
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00020.32
8.2.120.0040.00426.35
8.2.110.0000.00920.54
8.2.100.0120.00018.09
8.2.90.0050.00319.07
8.2.80.0050.00317.97
8.2.70.0080.00017.75
8.2.60.0110.00018.04
8.2.50.0030.00618.10
8.2.40.0070.00020.42
8.2.30.0040.00420.97
8.2.20.0040.00418.21
8.2.10.0020.00518.18
8.2.00.0030.00518.23
8.1.280.0150.00625.92
8.1.270.0060.00323.81
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00622.62
8.1.230.0110.00017.70
8.1.220.0050.00317.77
8.1.210.0060.00318.77
8.1.200.0050.00717.34
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0090.00018.65
8.1.160.0050.00218.88
8.1.150.0000.00720.30
8.1.140.0050.00219.68
8.1.130.0060.00318.81
8.1.120.0020.00517.59
8.1.110.0080.00017.54
8.1.100.0040.00417.54
8.1.90.0070.00017.53
8.1.80.0040.00417.64
8.1.70.0060.00317.56
8.1.60.0040.00417.75
8.1.50.0040.00417.70
8.1.40.0050.00317.71
8.1.30.0030.00617.66
8.1.20.0000.00817.75
8.1.10.0030.00517.56
8.1.00.0050.00317.66
8.0.300.0060.00318.77
8.0.290.0080.00017.00
8.0.280.0070.00018.56
8.0.270.0030.00517.31
8.0.260.0060.00316.86
8.0.250.0000.00717.18
8.0.240.0080.00017.00
8.0.230.0050.00517.12
8.0.220.0080.00017.05
8.0.210.0030.00316.95
8.0.200.0000.00717.08
8.0.190.0040.00417.07
8.0.180.0000.00816.98
8.0.170.0070.00017.12
8.0.160.0040.00417.03
8.0.150.0040.00416.96
8.0.140.0000.00716.91
8.0.130.0060.00013.48
8.0.120.0060.00317.05
8.0.110.0040.00416.96
8.0.100.0030.00616.89
8.0.90.0040.00417.07
8.0.80.0100.00717.07
8.0.70.0050.00316.91
8.0.60.0040.00417.18
8.0.50.0070.00017.09
8.0.30.0110.00817.38
8.0.20.0080.01117.49
8.0.10.0000.00817.05
8.0.00.0090.01217.01
7.4.330.0060.00015.55
7.4.320.0030.00316.88
7.4.300.0070.00016.87
7.4.290.0000.00916.83
7.4.280.0040.00416.74
7.4.270.0030.00316.75
7.4.260.0030.00316.75
7.4.250.0030.00516.65
7.4.240.0040.00416.77
7.4.230.0000.00716.85
7.4.220.0270.00516.83
7.4.210.0090.00616.64
7.4.200.0030.00316.59
7.4.160.0120.00616.72
7.4.150.0150.00317.40
7.4.140.0100.01217.86
7.4.130.0120.01616.63
7.4.120.0160.00616.75
7.4.110.0100.00716.80
7.4.100.0220.00316.53
7.4.90.0120.00616.63
7.4.80.0070.01019.39
7.4.70.0070.01316.64
7.4.60.0130.00316.49
7.4.50.0100.00716.48
7.4.40.0060.01116.77
7.4.30.0060.01116.74
7.4.00.0060.01215.05
7.3.330.0000.00613.32
7.3.320.0030.00313.32
7.3.310.0000.00716.54
7.3.300.0000.00716.59
7.3.290.0100.00916.52
7.3.280.0090.00816.48
7.3.270.0110.00717.40
7.3.260.0140.00716.83
7.3.250.0110.00716.48
7.3.240.0060.01216.64
7.3.230.0130.00316.50
7.3.210.0100.00716.83
7.3.200.0060.00916.75
7.3.190.0030.01616.75
7.3.180.0100.00716.67
7.3.170.0090.00916.72
7.3.160.0100.00716.77
7.2.330.0090.00916.93
7.2.320.0160.00516.79
7.2.310.0060.01016.91
7.2.300.0170.00616.92
7.2.290.0040.01216.80
7.2.110.0060.01016.66
7.2.60.0080.00816.97
7.2.50.0040.00817.16
7.1.200.0060.00915.84
7.1.70.0040.00417.46
7.1.60.1670.01033.38
7.1.50.1530.01033.18
7.1.40.1630.01732.93
7.1.30.2330.01032.89
7.1.20.1300.02033.01
7.1.10.1100.00314.89
7.1.00.1570.01015.23
7.0.200.2470.01014.73
7.0.190.1430.01714.71
7.0.180.1670.01314.73
7.0.170.1870.01314.71
7.0.160.2000.01314.60
7.0.150.1030.00714.70
7.0.140.1330.00714.86
7.0.130.1170.01714.75
7.0.120.1130.02014.71
7.0.110.0930.01314.78
7.0.100.1600.01314.57
7.0.90.1330.01014.61
7.0.80.1600.01014.60
7.0.70.0800.01314.66
7.0.60.1030.01014.61
7.0.50.0800.01014.65
7.0.40.1470.01014.65
7.0.30.1070.01014.84
7.0.20.0870.00714.57
7.0.10.0870.01014.83
7.0.00.0900.01314.69

preferences:
58.74 ms | 400 KiB | 5 Q