3v4l.org

run code in 300+ PHP versions simultaneously
<?php function c_substr($string, $from, $length = null){ preg_match_all('/[x80-xff]?./', $string, $match); if(is_null($length)){ $result = implode('', array_slice($match[0], $from)); }else{ $result = implode('', array_slice($match[0], $from, $length)); } return $result; } $str = "zhon华人min共和guo"; $from = 3; $length = 7; echo(c_substr($str, $from, $length));

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.40.0060.01218.96
8.3.30.0110.00420.09
8.3.20.0040.00420.21
8.3.10.0000.00822.09
8.3.00.0060.00322.46
8.2.170.0120.00322.96
8.2.160.0110.00320.52
8.2.150.0050.00524.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.01120.95
8.2.110.0030.00721.02
8.2.100.0130.00019.70
8.2.90.0040.00419.17
8.2.80.0060.00319.25
8.2.70.0080.00017.88
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0040.00418.08
8.2.30.0040.00419.39
8.2.20.0040.00417.85
8.2.10.0070.00017.89
8.2.00.0000.00717.82
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00021.17
8.1.230.0110.00019.01
8.1.220.0000.00917.77
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0030.00617.28
8.1.180.0030.00518.10
8.1.170.0000.00918.61
8.1.160.0040.00418.88
8.1.150.0000.00718.77
8.1.140.0070.00017.55
8.1.130.0070.00017.73
8.1.120.0040.00417.49
8.1.110.0000.00717.48
8.1.100.0000.00717.45
8.1.90.0000.00717.58
8.1.80.0000.00717.59
8.1.70.0000.00717.42
8.1.60.0060.00317.70
8.1.50.0000.00717.63
8.1.40.0030.00617.73
8.1.30.0070.00017.71
8.1.20.0080.00017.71
8.1.10.0000.00917.73
8.1.00.0030.00517.66
8.0.300.0040.00418.77
8.0.290.0040.00417.15
8.0.280.0030.00318.45
8.0.270.0000.00717.28
8.0.260.0040.00416.93
8.0.250.0030.00317.08
8.0.240.0080.00017.00
8.0.230.0030.00317.07
8.0.220.0000.00716.87
8.0.210.0040.00417.01
8.0.200.0030.00316.91
8.0.190.0040.00417.03
8.0.180.0030.00317.02
8.0.170.0050.00316.90
8.0.160.0000.00816.88
8.0.150.0030.00316.79
8.0.140.0050.00216.99
8.0.130.0060.00013.39
8.0.120.0040.00416.84
8.0.110.0070.00016.98
8.0.100.0050.00216.91
8.0.90.0000.00716.86
8.0.80.0100.00616.99
8.0.70.0040.00416.90
8.0.60.0030.00516.81
8.0.50.0030.00517.03
8.0.30.0160.00617.07
8.0.20.0160.00917.45
8.0.10.0000.00716.95
8.0.00.0160.00516.83
7.4.330.0000.00516.73
7.4.320.0000.00616.67
7.4.300.0030.00316.76
7.4.290.0000.00716.75
7.4.280.0000.00816.81
7.4.270.0030.00316.73
7.4.260.0060.00013.50
7.4.250.0040.00416.67
7.4.240.0000.00716.63
7.4.230.0000.00816.88
7.4.220.0100.01716.91
7.4.210.0040.01016.79
7.4.200.0000.00716.82
7.4.190.0030.00316.63
7.4.160.0080.00816.67
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0090.00916.73
7.4.120.0090.00716.79
7.4.110.0190.00316.78
7.4.100.0120.00616.48
7.4.90.0070.01016.80
7.4.80.0140.00619.39
7.4.70.0060.01016.58
7.4.60.0030.01316.57
7.4.50.0000.00816.58
7.4.40.0100.00322.77
7.4.30.0120.00616.84
7.4.10.0000.01814.92
7.4.00.0060.01115.17
7.3.330.0000.00513.32
7.3.320.0000.00613.40
7.3.310.0030.00316.47
7.3.300.0000.00716.30
7.3.290.0090.00616.36
7.3.280.0080.01016.38
7.3.270.0040.01417.40
7.3.260.0040.01416.40
7.3.250.0090.00916.44
7.3.240.0120.00616.65
7.3.230.0110.01516.39
7.3.210.0070.01016.46
7.3.200.0120.00919.39
7.3.190.0040.01416.71
7.3.180.0070.01316.76
7.3.170.0130.00316.50
7.3.160.0090.01016.42
7.3.130.0110.00714.50
7.3.120.0100.00714.73
7.3.110.0090.00614.93
7.3.100.0070.00714.79
7.3.90.0050.00814.81
7.3.80.0130.00015.03
7.3.70.0040.01114.88
7.3.60.0040.01014.83
7.3.50.0100.00314.66
7.3.40.0060.00614.98
7.3.30.0070.00714.89
7.3.20.0090.00616.65
7.3.10.0030.01316.63
7.3.00.0100.00616.72
7.2.330.0110.00716.73
7.2.320.0070.01016.86
7.2.310.0110.00716.66
7.2.300.0130.00316.80
7.2.290.0090.00616.86
7.2.260.0060.00615.30
7.2.250.0030.00714.95
7.2.240.0100.00715.26
7.2.230.0120.00615.00
7.2.220.0140.00015.38
7.2.210.0030.00614.95
7.2.200.0070.00715.04
7.2.190.0040.01215.17
7.2.180.0060.00914.89
7.2.170.0030.00915.18
7.2.160.0070.00715.33
7.2.150.0000.01217.19
7.2.140.0090.00617.11
7.2.130.0090.00616.93
7.2.120.0070.00716.92
7.2.110.0110.00417.17
7.2.100.0100.00616.94
7.2.90.0040.01517.23
7.2.80.0060.01017.32
7.2.70.0080.00817.24
7.2.60.0050.00817.01
7.2.50.0120.00317.25
7.2.40.0000.01417.04
7.2.30.0070.00417.04
7.2.20.0040.01517.11
7.2.10.0090.00616.99
7.2.00.0060.00518.36
7.1.330.0090.00615.80
7.1.320.0120.00415.79
7.1.310.0000.01515.73
7.1.300.0030.01015.66
7.1.290.0060.00615.81
7.1.280.0060.00915.55
7.1.270.0090.00615.93
7.1.260.0060.00916.09
7.1.250.0060.00615.69
7.1.240.0100.00315.93
7.1.230.0100.00315.98
7.1.220.0110.00415.68
7.1.210.0090.00615.98
7.1.200.0060.00715.91
7.1.190.0040.00816.09
7.1.180.0040.01215.71
7.1.170.0120.00315.95
7.1.160.0120.00316.10
7.1.150.0080.00415.82
7.1.140.0090.00015.88
7.1.130.0110.00316.09
7.1.120.0100.00715.97
7.1.110.0120.00315.98
7.1.100.0050.00817.15
7.1.90.0030.01215.86
7.1.80.0120.00616.10
7.1.70.0030.00716.81
7.1.60.0050.01417.61
7.1.50.0070.00916.37
7.1.40.0030.00915.95
7.1.30.0030.00715.90
7.1.20.0070.00715.95
7.1.10.0080.00816.00
7.1.00.0030.03919.19
7.0.330.0030.00915.53
7.0.320.0090.00715.72
7.0.310.0070.00315.63
7.0.300.0120.00015.55
7.0.290.0130.00015.30
7.0.280.0030.00715.44
7.0.270.0000.01015.58
7.0.260.0030.00615.45
7.0.250.0040.01115.27
7.0.240.0070.00715.48
7.0.230.0060.00915.41
7.0.220.0000.01215.62
7.0.210.0100.00715.56
7.0.200.0000.01016.12
7.0.190.0040.00715.52
7.0.180.0090.00615.51
7.0.170.0140.00015.38
7.0.160.0000.01215.59
7.0.150.0030.01315.69
7.0.140.0050.04218.89
7.0.130.0030.00615.61
7.0.120.0060.00915.55
7.0.110.0090.00615.50
7.0.100.0050.04217.75
7.0.90.0250.04017.78
7.0.80.0230.04417.77
7.0.70.0090.04017.76
7.0.60.0090.04217.62
7.0.50.0030.04717.92
7.0.40.0070.04416.90
7.0.30.0080.04516.93
7.0.20.0080.04116.77
7.0.10.0090.04016.85
7.0.00.0030.04916.89
5.6.400.0040.00814.58
5.6.390.0150.00014.38
5.6.380.0080.00814.35
5.6.370.0090.00814.35
5.6.360.0060.00914.64
5.6.350.0000.01414.71
5.6.340.0060.00614.32
5.6.330.0060.00614.26
5.6.320.0140.00014.54
5.6.310.0030.00614.02
5.6.300.0100.00614.16
5.6.290.0030.01214.26
5.6.280.0070.03717.70
5.6.270.0070.00714.42
5.6.260.0120.00314.26
5.6.250.0090.04217.37
5.6.240.0050.04617.51
5.6.230.0060.04717.33
5.6.220.0020.03117.59
5.6.210.0090.04617.55
5.6.200.0090.04517.59
5.6.190.0080.04417.64
5.6.180.0090.04117.74
5.6.170.0070.03417.62
5.6.160.0080.04017.55
5.6.150.0130.03817.66
5.6.140.0050.04717.78
5.6.130.0120.04517.64
5.6.120.0100.04317.53
5.6.110.0050.04517.82
5.6.100.0120.04017.65
5.6.90.0040.05317.80
5.6.80.0130.03617.29
5.6.70.0030.04317.44
5.6.60.0050.04717.38
5.6.50.0100.04017.33
5.6.40.0100.04217.26
5.6.30.0050.03317.17
5.6.20.0070.04017.44
5.6.10.0110.03317.26
5.6.00.0050.04217.42
5.5.380.0030.04217.29
5.5.370.0070.04717.19
5.5.360.0140.03517.46
5.5.350.0030.03617.14
5.5.340.0100.04317.46
5.5.330.0040.04417.62
5.5.320.0030.04017.52
5.5.310.0050.04817.78
5.5.300.0050.04017.58
5.5.290.0080.04217.65
5.5.280.0130.04317.65
5.5.270.0070.04717.47
5.5.260.0060.04617.44
5.5.250.0100.03917.40
5.5.240.0090.03617.22
5.5.230.0060.04117.04
5.5.220.0120.03817.18
5.5.210.0080.03317.27
5.5.200.0120.03717.32
5.5.190.0080.02417.19
5.5.180.0080.03217.18
5.5.170.0030.01214.04
5.5.160.0030.03017.19
5.5.150.0050.02817.17
5.5.140.0020.04017.14
5.5.130.0080.02517.21
5.5.120.0100.04117.30
5.5.110.0100.02317.05
5.5.100.0050.03017.25
5.5.90.0050.04217.15
5.5.80.0070.03717.05
5.5.70.0050.04517.13
5.5.60.0070.04217.18
5.5.50.0080.04117.06
5.5.40.0090.03817.01
5.5.30.0070.04217.19
5.5.20.0090.04316.95
5.5.10.0100.03817.09
5.5.00.0050.04317.19
5.4.450.0030.04215.19
5.4.440.0090.03415.26
5.4.430.0100.03515.30
5.4.420.0160.03415.14
5.4.410.0070.04415.27
5.4.400.0040.04414.91
5.4.390.0050.03315.18
5.4.380.0070.02715.05
5.4.370.0040.03215.09
5.4.360.0060.03615.00
5.4.350.0050.03915.14
5.4.340.0050.02015.13
5.4.330.0030.01011.22
5.4.320.0100.04015.06
5.4.310.0070.03014.99
5.4.300.0090.03615.28
5.4.290.0080.03515.02
5.4.280.0070.04015.15
5.4.270.0090.03714.98
5.4.260.0080.04015.13
5.4.250.0060.03115.13
5.4.240.0080.03814.95
5.4.230.0050.04114.92
5.4.220.0050.04215.09
5.4.210.0080.03815.00
5.4.200.0080.03815.18
5.4.190.0030.04514.93
5.4.180.0100.03315.16
5.4.170.0070.03815.08
5.4.160.0030.04215.03
5.4.150.0080.02015.10
5.4.140.0030.03613.79
5.4.130.0050.03613.60
5.4.120.0070.03713.63
5.4.110.0030.04313.73
5.4.100.0080.03613.67
5.4.90.0020.04213.62
5.4.80.0070.03713.82
5.4.70.0090.03913.58
5.4.60.0080.03513.61
5.4.50.0050.03713.86
5.4.40.0060.03813.83
5.4.30.0060.04113.75
5.4.20.0030.04313.74
5.4.10.0070.03913.65
5.4.00.0060.03613.51
5.3.290.0070.03812.71
5.3.280.0050.04012.56
5.3.270.0090.03712.64
5.3.260.0000.04612.63
5.3.250.0070.03312.68
5.3.240.0030.04112.55
5.3.230.0070.04112.42
5.3.220.0030.04312.47
5.3.210.0100.02812.55
5.3.200.0060.04112.61
5.3.190.0070.03712.67
5.3.180.0050.03512.53
5.3.170.0030.04312.59
5.3.160.0060.03612.64
5.3.150.0050.04212.70
5.3.140.0090.03612.73
5.3.130.0070.04212.63
5.3.120.0080.03012.63
5.3.110.0060.04312.47
5.3.100.0060.03812.25
5.3.90.0030.04212.47
5.3.80.0030.04312.19
5.3.70.0050.03112.31
5.3.60.0020.02512.29
5.3.50.0070.03912.22
5.3.40.0050.03312.24
5.3.30.0030.04012.26
5.3.20.0030.03912.13
5.3.10.0020.03812.09
5.3.00.0030.04411.99
5.2.170.0000.07011.18
5.2.160.0030.06711.16
5.2.150.0100.05311.17
5.2.140.0070.04711.03
5.2.130.0070.05011.18
5.2.120.0070.05711.16
5.2.110.0070.05011.09
5.2.100.0030.06011.02
5.2.90.0070.04711.17
5.2.80.0100.02311.21
5.2.70.0030.05711.23
5.2.60.0100.05711.11
5.2.50.0170.05311.01
5.2.40.0000.06311.07
5.2.30.0170.05011.04
5.2.20.0030.06311.10
5.2.10.0070.05710.91
5.2.00.0070.06310.77
5.1.60.0070.04710.08
5.1.50.0070.0409.88
5.1.40.0070.0309.97
5.1.30.0100.05310.34
5.1.20.0000.06010.47
5.1.10.0070.04010.08
5.1.00.0030.02710.14
5.0.50.0030.0438.57
5.0.40.0030.0338.46
5.0.30.0100.0478.14
5.0.20.0030.0438.29
5.0.10.0100.0308.16
5.0.00.0030.0678.14
4.4.90.0030.0208.14
4.4.80.0070.0338.14
4.4.70.0000.0338.14
4.4.60.0070.0208.14
4.4.50.0000.0378.14
4.4.40.0000.0408.14
4.4.30.0070.0208.14
4.4.20.0030.0278.14
4.4.10.0070.0308.14
4.4.00.0030.0478.14
4.3.110.0030.0278.14
4.3.100.0000.0338.14
4.3.90.0000.0378.14
4.3.80.0070.0478.14
4.3.70.0000.0338.14
4.3.60.0030.0138.14
4.3.50.0030.0178.14
4.3.40.0000.0278.14
4.3.30.0000.0208.14
4.3.20.0000.0178.14
4.3.10.0030.0138.14
4.3.00.0000.0178.14

preferences:
41.61 ms | 400 KiB | 5 Q