3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReformatPhoneNumber($number) { if(strlen($number) > 12 || strlen($number) < 7) throw new Exception("Invalid phone number"); if(preg_match('/^\d+(\d-\d)?\d*(\d\s\d)?\d+$/', $number) === 1) return str_replace(array('-', ' '), '', $number); } //echo ReformatPhoneNumber('012345'); function MaxArray($arr) { $max = 0; foreach($arr as $element) { if(is_array($element)) $max = MaxArray($element) > $max ? MaxArray($element) : $max; else $max = $element > $max ? $element : $max; } return $max; } $arr = array(array(141,151,161), 2, 3, array(101, 202, array(303,404))); echo MaxArray($arr); echo strtok("Hello", "");

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.0040.01118.31
8.3.50.0110.00821.21
8.3.40.0070.00718.60
8.3.30.0070.00720.14
8.3.20.0040.00420.59
8.3.10.0050.00320.95
8.3.00.0020.00523.48
8.2.180.0070.00716.50
8.2.170.0140.00722.96
8.2.160.0070.01020.48
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0040.00420.96
8.2.110.0080.00019.27
8.2.100.0060.00617.72
8.2.90.0000.00819.05
8.2.80.0060.00319.46
8.2.70.0030.00617.50
8.2.60.0080.00017.93
8.2.50.0030.00718.07
8.2.40.0030.00518.22
8.2.30.0000.00719.38
8.2.20.0000.00817.74
8.2.10.0040.00417.68
8.2.00.0070.00017.62
8.1.280.0120.00425.92
8.1.270.0060.00323.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01320.68
8.1.230.0030.00720.88
8.1.220.0000.00818.77
8.1.210.0050.00318.97
8.1.200.0060.00317.35
8.1.190.0050.00317.52
8.1.180.0040.00418.10
8.1.170.0060.00618.50
8.1.160.0040.00418.90
8.1.150.0040.00418.71
8.1.140.0040.00417.48
8.1.130.0030.00317.75
8.1.120.0040.00417.54
8.1.110.0000.00717.46
8.1.100.0040.00417.52
8.1.90.0000.00717.50
8.1.80.0020.00517.37
8.1.70.0030.00317.39
8.1.60.0060.00317.63
8.1.50.0040.00417.49
8.1.40.0070.00017.52
8.1.30.0000.00717.68
8.1.20.0030.00617.61
8.1.10.0050.00217.49
8.1.00.0000.00717.42
8.0.300.0000.00819.96
8.0.290.0070.00017.05
8.0.280.0000.00718.46
8.0.270.0000.00817.22
8.0.260.0040.00418.48
8.0.250.0050.00316.88
8.0.240.0020.00516.93
8.0.230.0030.00316.95
8.0.220.0000.00716.95
8.0.210.0030.00316.81
8.0.200.0030.00316.95
8.0.190.0070.00016.85
8.0.180.0040.00416.83
8.0.170.0030.00516.82
8.0.160.0040.00416.93
8.0.150.0000.00716.93
8.0.140.0000.00716.91
8.0.130.0000.00613.38
8.0.120.0000.00716.80
8.0.110.0070.00016.81
8.0.100.0040.00416.89
8.0.90.0070.00016.94
8.0.80.0090.00616.91
8.0.70.0030.00516.90
8.0.60.0000.00716.79
8.0.50.0040.00416.93
8.0.30.0060.01617.19
8.0.20.0060.01317.40
8.0.10.0070.00017.09
8.0.00.0090.00916.71
7.4.330.0030.00315.07
7.4.320.0000.00616.52
7.4.300.0060.00016.50
7.4.290.0040.00416.58
7.4.280.0070.00016.51
7.4.270.0000.00716.54
7.4.260.0000.00513.21
7.4.250.0000.00816.62
7.4.240.0000.00716.70
7.4.230.0080.00016.59
7.4.220.0040.01516.72
7.4.210.0080.00816.53
7.4.200.0070.00016.61
7.4.190.0000.00716.57
7.4.160.0070.01016.42
7.4.150.0120.00617.40
7.4.140.0100.01217.86
7.4.130.0090.01016.56
7.4.120.0070.01216.43
7.4.110.0110.00816.58
7.4.100.0040.01416.52
7.4.90.0060.01116.59
7.4.80.0060.01219.39
7.4.70.0160.00316.53
7.4.60.0170.01316.61
7.4.50.0030.00616.62
7.4.40.0040.01122.77
7.4.30.0140.00816.53
7.4.10.0110.00615.05
7.4.00.0060.01015.00
7.3.330.0060.00013.34
7.3.320.0000.00513.36
7.3.310.0030.00316.30
7.3.300.0030.00316.18
7.3.290.0120.00916.23
7.3.280.0100.00916.29
7.3.270.0030.01317.40
7.3.260.0120.00618.24
7.3.250.0060.01216.40
7.3.240.0030.01316.35
7.3.230.0100.00616.57
7.3.210.0110.01016.49
7.3.200.0180.00419.39
7.3.190.0110.01116.47
7.3.180.0060.01016.42
7.3.170.0110.01116.29
7.3.160.0200.00316.30
7.3.130.0090.00915.11
7.3.120.0060.01014.94
7.3.110.0130.00614.96
7.3.100.0060.00314.41
7.3.90.0040.01114.80
7.3.80.0110.00414.93
7.3.70.0000.01214.88
7.3.60.0030.00914.86
7.3.50.0040.00714.78
7.3.40.0070.00714.68
7.3.30.0000.01214.87
7.3.20.0040.01116.69
7.3.10.0040.00816.65
7.3.00.0060.00616.44
7.2.330.0090.01216.70
7.2.320.0110.00716.77
7.2.310.0090.00916.75
7.2.300.0110.00616.73
7.2.290.0030.01416.56
7.2.260.0090.01215.17
7.2.250.0130.00714.93
7.2.240.0110.00615.22
7.2.230.0040.01115.20
7.2.220.0090.00615.16
7.2.210.0040.00814.77
7.2.200.0000.01415.02
7.2.190.0030.01114.78
7.2.180.0090.00615.07
7.2.170.0040.00814.82
7.2.160.0040.01115.11
7.2.150.0060.00316.57
7.2.140.0000.01516.78
7.2.130.0110.00416.89
7.2.120.0080.00816.93
7.2.110.0070.00716.98
7.2.100.0000.01316.88
7.2.90.0040.00816.91
7.2.80.0060.00916.93
7.2.70.0030.00916.79
7.2.60.0100.00416.86
7.2.50.0090.00616.72
7.2.40.0040.00717.00
7.2.30.0030.01416.93
7.2.20.0070.00717.02
7.2.10.0100.00716.83
7.2.00.0060.00616.73
7.1.330.0070.00715.72
7.1.320.0060.00915.83
7.1.310.0060.00615.54
7.1.300.0040.01115.75
7.1.290.0030.01015.82
7.1.280.0000.01115.70
7.1.270.0000.00915.58
7.1.260.0000.01415.70
7.1.250.0070.01015.72
7.1.240.0060.00915.55
7.1.230.0030.00515.82
7.1.220.0100.00715.56
7.1.210.0000.01015.63
7.1.200.0050.00815.73
7.1.190.0060.00615.68
7.1.180.0110.00315.90
7.1.170.0070.01115.90
7.1.160.0000.00915.76
7.1.150.0070.00715.94
7.1.140.0120.00315.80
7.1.130.0040.01215.76
7.1.120.0080.00815.70
7.1.110.0070.00715.79
7.1.100.0100.00715.81
7.1.90.0030.01115.71
7.1.80.0070.00715.77
7.1.70.0050.00616.56
7.1.60.0070.01217.46
7.1.50.0050.00616.40
7.1.40.0040.00715.91
7.1.30.0030.00915.59
7.1.20.0040.00715.63
7.1.10.0000.01315.83
7.1.00.0030.04419.07
7.0.330.0030.01015.41
7.0.320.0050.00815.44
7.0.310.0030.00915.11
7.0.300.0030.01015.40
7.0.290.0030.00915.22
7.0.280.0000.01315.44
7.0.270.0040.00815.31
7.0.260.0000.00915.56
7.0.250.0030.00915.57
7.0.240.0080.00315.44
7.0.230.0070.00715.38
7.0.220.0080.00315.32
7.0.210.0070.01015.38
7.0.200.0010.00815.96
7.0.190.0000.01215.28
7.0.180.0100.00315.50
7.0.170.0100.00315.45
7.0.160.0040.00815.41
7.0.150.0030.01315.38
7.0.140.0050.04018.69
7.0.130.0110.00615.58
7.0.120.0030.00715.51
7.0.110.0080.00315.39
7.0.100.0000.01415.46
7.0.90.0110.00315.38
7.0.80.0070.00715.13
7.0.70.0080.04018.53
7.0.60.0070.02718.56
7.0.50.0050.04718.70
7.0.40.0030.03316.65
7.0.30.0030.03716.69
7.0.20.0050.03016.71
7.0.10.0030.04516.85
7.0.00.0050.02616.69
5.6.400.0060.00914.25
5.6.390.0000.01113.86
5.6.380.0100.00614.50
5.6.370.0030.00714.38
5.6.360.0030.01014.07
5.6.350.0090.00614.47
5.6.340.0040.01114.58
5.6.330.0040.01113.99
5.6.320.0030.00914.30
5.6.310.0070.00414.45
5.6.300.0060.00914.42
5.6.290.0090.00914.52
5.6.280.0040.04117.71
5.6.270.0000.01014.35
5.6.260.0000.01314.13
5.6.250.0110.00414.14
5.6.240.0070.00714.13
5.6.230.0070.01014.27
5.6.220.0030.03417.62
5.6.210.0060.02817.45
5.6.200.0030.03917.55
5.6.190.0050.04717.67
5.6.180.0050.04217.59
5.6.170.0040.03417.65
5.6.160.0090.02317.46
5.6.150.0030.03017.57
5.6.140.0150.03717.57
5.6.130.0090.04517.75
5.6.120.0080.04117.65
5.6.110.0050.04217.78
5.6.100.0120.04317.76
5.6.90.0030.05117.71
5.6.80.0020.03017.28
5.6.70.0020.04817.25
5.6.60.0120.03317.23
5.6.50.0020.04717.36
5.6.40.0030.03417.39
5.6.30.0020.04617.36
5.6.20.0020.02417.35
5.6.10.0080.01817.13
5.6.00.0050.02217.29
5.5.380.0030.01014.20
5.5.370.0100.00714.04
5.5.360.0040.05117.25
5.5.350.0030.03417.35
5.5.340.0070.04317.59
5.5.330.0030.04617.57
5.5.320.0030.03017.48
5.5.310.0060.02517.62
5.5.300.0090.04217.50
5.5.290.0020.04917.54
5.5.280.0040.03417.44
5.5.270.0050.03617.45
5.5.260.0020.02917.53
5.5.250.0070.03217.39
5.5.240.0020.04817.04
5.5.230.0090.04117.04
5.5.220.0060.02817.17
5.5.210.0050.03217.22
5.5.200.0080.04217.27
5.5.190.0050.04517.22
5.5.180.0030.04717.23
5.5.170.0060.00313.91
5.5.160.0000.02717.13
5.5.150.0070.02317.06
5.5.140.0030.02717.03
5.5.130.0020.03017.04
5.5.120.0060.02217.20
5.5.110.0070.02517.09
5.5.100.0070.02017.22
5.5.90.0060.01717.02
5.5.80.0020.02216.91
5.5.70.0040.02017.15
5.5.60.0090.01816.91
5.5.50.0020.02517.06
5.5.40.0030.02417.05
5.5.30.0050.02217.14
5.5.20.0000.03617.16
5.5.10.0020.02217.15
5.5.00.0050.02517.12
5.4.450.0060.04115.41
5.4.440.0080.02615.43
5.4.430.0020.04815.04
5.4.420.0030.04915.31
5.4.410.0050.04315.17
5.4.400.0050.02215.02
5.4.390.0030.03115.11
5.4.380.0020.04214.98
5.4.370.0100.04214.94
5.4.360.0060.04515.16
5.4.350.0070.04214.94
5.4.340.0060.02514.85
5.4.330.0060.01011.16
5.4.320.0060.02214.86
5.4.310.0060.02315.09
5.4.300.0090.02014.96
5.4.290.0050.02115.14
5.4.280.0060.02315.16
5.4.270.0040.01815.05
5.4.260.0050.01914.85
5.4.250.0070.01914.86
5.4.240.0060.02214.97
5.4.230.0020.02915.05
5.4.220.0050.03115.16
5.4.210.0030.02514.86
5.4.200.0060.02215.07
5.4.190.0020.02515.08
5.4.180.0040.02414.79
5.4.170.0060.03815.07
5.4.160.0020.02714.86
5.4.150.0070.02915.06
5.4.140.0050.02513.64
5.4.130.0050.02313.69
5.4.120.0040.03513.72
5.4.110.0030.02413.87
5.4.100.0020.02413.59
5.4.90.0050.01813.80
5.4.80.0050.02213.82
5.4.70.0040.02113.81
5.4.60.0050.02113.56
5.4.50.0060.03813.81
5.4.40.0040.04013.76
5.4.30.0100.03813.82
5.4.20.0070.01813.85
5.4.10.0050.01913.67
5.4.00.0050.01913.33
5.3.290.0050.02212.62
5.3.280.0050.03112.70
5.3.270.0060.02012.50
5.3.260.0040.03012.69
5.3.250.0040.03112.66
5.3.240.0070.02512.59
5.3.230.0030.02412.58
5.3.220.0070.01912.52
5.3.210.0050.02712.55
5.3.200.0070.01812.45
5.3.190.0020.02112.63
5.3.180.0040.02512.63
5.3.170.0050.02212.62
5.3.160.0060.02012.58
5.3.150.0040.02212.56
5.3.140.0060.02712.46
5.3.130.0020.03312.58
5.3.120.0060.02412.66
5.3.110.0090.03312.52
5.3.100.0050.02212.28
5.3.90.0030.02412.31
5.3.80.0060.02012.27
5.3.70.0080.01712.27
5.3.60.0070.01812.27
5.3.50.0020.02512.20
5.3.40.0050.02212.23
5.3.30.0050.02012.29
5.3.20.0020.02212.13
5.3.10.0040.02012.08
5.3.00.0050.03311.98
5.2.170.0000.03712.26
5.2.160.0030.02012.26
5.2.150.0000.02712.26
5.2.140.0000.03012.26
5.2.130.0000.03012.26
5.2.120.0000.02712.26
5.2.110.0000.02712.26
5.2.100.0000.04012.26
5.2.90.0030.03012.26
5.2.80.0000.06312.26
5.2.70.0000.06012.26
5.2.60.0070.06012.26
5.2.50.0000.06312.26
5.2.40.0030.03712.26
5.2.30.0000.06712.26
5.2.20.0000.06712.26
5.2.10.0000.06012.26
5.2.00.0030.06012.26
5.1.60.0030.05312.26
5.1.50.0030.05312.26
5.1.40.0070.05012.26
5.1.30.0070.05012.26
5.1.20.0030.06012.26
5.1.10.0030.05312.26
5.1.00.0030.06012.26
5.0.50.0030.04312.26
5.0.40.0030.04312.26
5.0.30.0030.06312.26
5.0.20.0000.03312.26
5.0.10.0000.02712.26
5.0.00.0000.06012.26
4.4.90.0030.02712.26
4.4.80.0000.02712.26
4.4.70.0000.01712.26
4.4.60.0030.03312.26
4.4.50.0000.03012.26
4.4.40.0000.05712.26
4.4.30.0000.03312.26
4.4.20.0000.03312.26
4.4.10.0030.02712.26
4.4.00.0030.04012.26
4.3.110.0000.04012.26
4.3.100.0000.03312.26
4.3.90.0070.02012.26
4.3.80.0000.04712.26
4.3.70.0000.02012.26
4.3.60.0000.02312.26
4.3.50.0000.02312.26
4.3.40.0000.05312.26
4.3.30.0000.03312.26
4.3.20.0000.02312.26
4.3.10.0000.03712.26
4.3.00.0030.03012.26

preferences:
106.27 ms | 401 KiB | 5 Q