3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '/NameType /FlateDecode /Contents[4 0 R 42]/Fonts<</F1 41/F2 43>>/NullType null/StringType(hello))/DateType(D:20130901235555+02\'00\')/XRefType 2 0 R /NumericType 8/HexaType<0020>/BooleanType false'; if (preg_match('/^\s*\((?P<name>.*)/s', $content, $match)) { } $offset=0; $position=0; if (preg_match('/^\s*(?P<name>\/[A-Z0-9\._]+)(?P<value>.*)/si', substr($content, 0), $match)) { $name = ltrim($match['name'], '/'); $value = $match['value']; $position = strpos($content, $value, $position + strlen($match['name'])); print_r($position); } $offset=$position; if (preg_match('/^\s*\((?P<name>.*)/s', $value, $match)) { $name = $match['name']; // Find next ')' not escaped. $cur_start_text = $start_search_end = 0; while (($cur_start_pos = strpos($name, ')/', $start_search_end)) !== false) { $cur_extract = substr($name, $cur_start_text, $cur_start_pos - $cur_start_text); preg_match('/(?P<escape>[\\\]*)$/s', $cur_extract, $match); if (!(strlen($match['escape']) % 2)) { break; } $start_search_end = $cur_start_pos + 1; } // Extract string. $name = substr($name, 0, $cur_start_pos); $offset += strpos($content, '(') + $cur_start_pos + 2; // 2 for '(' and ')' $name = str_replace( array('\\\\', '\\ ', '\\/', '\(', '\)', '\n', '\r', '\t'), array('\\', ' ', '/', '(', ')', "\n", "\r", "\t"), $name ); print_r($name); } // your code goes here echo "test";

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.00918.95
8.3.30.0200.00019.09
8.3.20.0040.00420.34
8.3.10.0000.00721.95
8.3.00.0040.00422.43
8.2.170.0110.00322.96
8.2.160.0110.00421.20
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0090.00017.75
8.2.110.0050.00522.21
8.2.100.0040.00819.82
8.2.90.0050.00319.34
8.2.80.0000.01017.97
8.2.70.0030.00617.75
8.2.60.0040.00418.04
8.2.50.0030.00518.07
8.2.40.0030.00618.34
8.2.30.0000.00718.13
8.2.20.0050.00317.86
8.2.10.0050.00317.95
8.2.00.0000.00717.87
8.1.270.0040.00422.31
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0030.00623.87
8.1.230.0110.00319.29
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0000.01017.35
8.1.190.0050.00317.53
8.1.180.0080.00018.10
8.1.170.0030.00618.79
8.1.160.0000.00722.03
8.1.150.0040.00418.64
8.1.140.0030.00517.59
8.1.130.0000.00717.90
8.1.120.0000.00817.59
8.1.110.0000.00717.54
8.1.100.0000.00817.57
8.1.90.0080.00017.55
8.1.80.0000.00817.60
8.1.70.0050.00217.62
8.1.60.0060.00317.77
8.1.50.0040.00417.66
8.1.40.0040.00417.68
8.1.30.0060.00317.73
8.1.20.0000.00917.81
8.1.10.0030.00617.84
8.1.00.0000.00817.75
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0000.00718.51
8.0.270.0000.00717.37
8.0.260.0000.00716.97
8.0.250.0000.00717.02
8.0.240.0030.00317.12
8.0.230.0030.00317.08
8.0.220.0030.00316.92
8.0.210.0040.00416.95
8.0.200.0040.00417.04
8.0.190.0040.00416.92
8.0.180.0000.00717.02
8.0.170.0020.00516.93
8.0.160.0050.00216.83
8.0.150.0040.00417.00
8.0.140.0000.00716.86
8.0.130.0000.00613.48
8.0.120.0050.00316.96
8.0.110.0050.00216.92
8.0.100.0040.00417.05
8.0.90.0000.00917.09
8.0.80.0090.00617.02
8.0.70.0040.00417.02
8.0.60.0000.00716.99
8.0.50.0030.00516.90
8.0.30.0130.01017.03
8.0.20.0120.00617.40
8.0.10.0040.00417.21
8.0.00.0100.00816.92
7.4.330.0050.00015.09
7.4.320.0060.00016.70
7.4.300.0040.00416.60
7.4.290.0030.00316.71
7.4.280.0030.00316.79
7.4.270.0040.00416.70
7.4.260.0080.00016.59
7.4.250.0040.00416.57
7.4.240.0050.00316.74
7.4.230.0000.00716.89
7.4.220.0180.00916.76
7.4.210.0080.01116.75
7.4.200.0000.00716.77
7.4.190.0050.00316.88
7.4.160.0090.00916.85
7.4.150.0110.00617.40
7.4.140.0090.00917.86
7.4.130.0130.00916.68
7.4.120.0110.01016.78
7.4.110.0060.01816.74
7.4.100.0120.00616.88
7.4.90.0160.00616.75
7.4.80.0070.01419.39
7.4.70.0090.00616.82
7.4.60.0090.00916.79
7.4.50.0040.00416.59
7.4.40.0140.00022.77
7.4.30.0130.00316.89
7.4.00.0100.00715.08
7.3.330.0000.00513.13
7.3.320.0000.00513.34
7.3.310.0000.00716.39
7.3.300.0030.00316.43
7.3.290.0040.01616.53
7.3.280.0070.00916.48
7.3.270.0000.01717.40
7.3.260.0080.00816.48
7.3.250.0090.01116.58
7.3.240.0100.01016.89
7.3.230.0120.00616.80
7.3.210.0100.00716.61
7.3.200.0100.01419.39
7.3.190.0160.00316.56
7.3.180.0110.00716.80
7.3.170.0030.01316.55
7.3.160.0130.00316.67
7.3.120.0110.00715.28
7.3.10.0070.00716.61
7.3.00.0060.00316.86
7.2.330.0060.01316.83
7.2.320.0130.00416.84
7.2.310.0130.00316.77
7.2.300.0090.01016.87
7.2.290.0070.01016.86
7.2.130.0130.00716.80
7.2.120.0130.00717.00
7.2.110.0030.01017.20
7.2.100.0030.00817.01
7.2.90.0100.01017.01
7.2.80.0150.00616.77
7.2.70.0070.01016.80
7.2.60.0030.01116.90
7.2.50.0060.00917.01
7.2.40.0040.01116.97
7.2.30.0160.00016.97
7.2.20.0060.01816.77
7.2.10.0170.01016.96
7.2.00.0100.01018.12
7.1.250.0150.00715.71
7.1.200.0090.00616.02
7.1.100.0000.01518.59
7.1.70.0000.01017.47
7.1.60.0170.00719.82
7.1.50.0070.01417.23
7.1.00.0130.06722.30
7.0.200.0080.00317.07
7.0.140.0000.07321.91
7.0.60.0170.07020.09
7.0.50.0100.05317.93
7.0.40.0200.05720.25
7.0.30.0200.08020.02
7.0.20.0370.04320.19
7.0.10.0230.04320.03
7.0.00.0030.09320.07
5.6.280.0130.06321.10
5.6.210.0030.08320.74
5.6.200.0130.08318.12
5.6.190.0030.05320.43
5.6.180.4070.05020.37
5.6.170.0300.08020.47
5.6.160.0100.06020.46
5.6.150.0200.07318.18
5.6.140.0030.06018.07
5.6.130.0030.08018.09
5.6.120.0170.05021.02
5.6.110.0170.03021.02
5.6.100.0130.07720.98
5.6.90.0100.07021.00
5.6.80.0070.07720.29
5.5.350.0000.08720.33
5.5.340.0070.07318.01
5.5.330.0070.04320.25
5.5.320.0200.04020.20
5.5.310.0070.04720.34
5.5.300.0130.07717.98
5.5.290.0030.05018.01
5.5.280.0200.06720.88
5.5.270.0030.04020.77
5.5.260.0070.04720.90
5.5.250.0070.06720.80
5.5.240.0030.04020.26
5.4.450.0270.05719.58
5.4.440.0330.06019.56
5.4.430.1170.00019.52
5.4.420.1330.00019.53
5.4.410.0130.07318.98
5.4.400.0070.07718.62
5.4.390.0070.05318.71
5.4.380.0300.05718.58
5.4.370.0330.04718.77
5.4.360.0270.04718.48
5.4.350.0200.05318.48
5.4.340.0130.06318.51
5.4.320.0090.03412.47
5.4.310.0060.03912.46
5.4.300.0080.03412.46
5.4.290.0060.03912.46
5.4.280.0000.04012.36
5.4.270.0030.06718.91
5.4.260.0100.05018.75
5.4.250.0200.05018.84
5.4.240.0100.06319.09
5.4.230.0130.05019.01
5.4.220.0030.05719.09
5.4.210.0230.05318.78
5.4.200.0100.04718.88
5.4.190.0100.05018.93
5.4.180.0070.06018.87
5.4.170.0200.05718.95
5.4.160.0070.05318.91
5.4.150.0170.07018.85
5.4.140.0170.04316.61
5.4.130.0130.04316.58
5.4.120.0070.05016.48
5.4.110.0030.05716.34
5.4.100.0070.07016.39
5.4.90.0130.04316.55
5.4.80.0070.05716.49
5.4.70.0130.05716.26
5.4.60.0100.06316.35
5.4.50.0130.05716.30
5.4.40.0130.06316.54
5.4.30.0100.06316.25
5.4.20.0030.05716.52
5.4.10.0070.08016.55
5.4.00.0070.05315.71
5.3.290.0110.03512.80
5.3.280.0100.05014.68
5.3.270.0130.05314.61
5.3.260.0030.05714.77
5.3.250.0070.05014.61
5.3.240.0030.05314.79
5.3.230.0100.05014.77
5.3.220.0100.07014.74
5.3.210.0130.04714.74
5.3.200.0200.04014.74
5.3.190.0030.06014.67
5.3.180.0030.06714.63
5.3.170.0100.05014.54
5.3.160.0100.04714.55
5.3.150.0130.04714.50
5.3.140.0100.06014.56
5.3.130.0100.07014.66
5.3.120.0170.06314.76
5.3.110.0130.05714.68
5.3.100.0100.05014.20
5.3.90.0170.06314.07
5.3.80.0070.05014.02
5.3.70.0030.05714.22
5.3.60.0130.07014.17
5.3.50.0200.05013.91
5.3.40.0170.04714.07
5.3.30.0200.06014.08
5.3.20.0030.05713.69
5.3.10.0030.05713.47
5.3.00.0130.05013.64
5.2.170.0130.04311.38
5.2.160.0070.04710.97
5.2.150.0000.07011.39
5.2.140.0100.04311.32
5.2.130.0000.04711.18
5.2.120.0070.03711.24
5.2.110.0070.04311.05
5.2.100.0030.05711.31
5.2.90.0070.06011.33
5.2.80.0070.04311.32
5.2.70.0030.05711.27
5.2.60.0070.04710.88
5.2.50.0000.05711.17
5.2.40.0000.05311.21
5.2.30.0070.05311.14
5.2.20.0100.05311.18
5.2.10.0030.04711.04
5.2.00.0170.04310.93
5.1.60.0130.04710.05
5.1.50.0000.04310.24
5.1.40.0130.03310.20
5.1.30.0130.03710.67
5.1.20.0130.04010.41
5.1.10.0100.03310.37
5.1.00.0100.03310.07
5.0.50.0100.0338.86
5.0.40.0000.0338.71
5.0.30.0030.0608.43
5.0.20.0030.0308.30
5.0.10.0000.0408.26
5.0.00.0030.0478.26
4.4.90.0030.0277.66
4.4.80.0000.0337.66
4.4.70.0170.0207.66
4.4.60.0030.0207.66
4.4.50.0100.0277.66
4.4.40.0000.0507.66
4.4.30.0000.0337.66
4.4.20.0000.0337.66
4.4.10.0070.0237.66
4.4.00.0000.0407.66
4.3.110.0070.0237.66
4.3.100.0030.0237.66
4.3.90.0030.0207.66
4.3.80.0100.0377.66
4.3.70.0000.0277.66
4.3.60.0000.0237.66
4.3.50.0030.0307.66
4.3.40.0030.0337.66
4.3.30.0030.0277.66
4.3.20.0070.0237.66
4.3.10.0030.0207.66
4.3.00.0100.0206.47

preferences:
39.54 ms | 400 KiB | 5 Q