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; if (preg_match('/^\s*(?P<name>\/[A-Z0-9\._]+)(?P<value>.*)/si', substr($content, 0), $match)) { print_r($match); $name = ltrim($match['name'], '/'); $value = $match['value']; $position = strpos($content, $value, $position + strlen($match['name'])); print_r($position); } if (preg_match('/^\s*\((?P<name>.*)/s', $content, $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.60.0160.00618.43
8.3.50.0120.00822.20
8.3.40.0110.00419.01
8.3.30.0100.01019.07
8.3.20.0040.00420.16
8.3.10.0050.00322.13
8.3.00.0040.00422.44
8.2.180.0190.00316.63
8.2.170.0070.00722.96
8.2.160.0100.01021.11
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00519.61
8.2.110.0030.00722.43
8.2.100.0040.00819.88
8.2.90.0040.00419.23
8.2.80.0030.00818.03
8.2.70.0080.00017.75
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0040.00418.13
8.2.20.0000.00817.92
8.2.10.0000.00817.91
8.2.00.0030.00617.82
8.1.280.0060.01225.92
8.1.270.0060.00322.05
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0030.00623.70
8.1.230.0040.00819.13
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00917.47
8.1.190.0000.00817.53
8.1.180.0080.00018.10
8.1.170.0060.00318.71
8.1.160.0040.00422.13
8.1.150.0040.00418.79
8.1.140.0040.00417.46
8.1.130.0000.00717.84
8.1.120.0040.00417.49
8.1.110.0040.00417.45
8.1.100.0050.00317.57
8.1.90.0050.00217.46
8.1.80.0080.00017.60
8.1.70.0030.00317.61
8.1.60.0030.00517.74
8.1.50.0030.00617.64
8.1.40.0030.00517.65
8.1.30.0040.00417.70
8.1.20.0040.00417.73
8.1.10.0040.00417.64
8.1.00.0000.00817.60
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0030.00318.51
8.0.270.0070.00017.23
8.0.260.0080.00017.07
8.0.250.0030.00317.11
8.0.240.0000.00717.16
8.0.230.0020.00517.17
8.0.220.0070.00017.09
8.0.210.0030.00317.11
8.0.200.0030.00317.14
8.0.190.0040.00417.16
8.0.180.0040.00417.07
8.0.170.0000.00717.12
8.0.160.0040.00417.18
8.0.150.0090.00017.05
8.0.140.0050.00216.93
8.0.130.0030.00313.50
8.0.120.0040.00416.91
8.0.110.0070.00017.03
8.0.100.0040.00417.09
8.0.90.0030.00517.20
8.0.80.0030.01216.96
8.0.70.0050.00317.15
8.0.60.0000.00717.13
8.0.50.0050.00316.97
8.0.30.0120.00917.38
8.0.20.0120.00817.48
8.0.10.0050.00217.20
8.0.00.0130.00816.93
7.4.330.0000.00515.00
7.4.320.0000.00616.70
7.4.300.0030.00316.79
7.4.290.0040.00416.60
7.4.280.0070.00016.58
7.4.270.0070.00016.80
7.4.260.0000.00716.79
7.4.250.0040.00416.77
7.4.240.0020.00516.71
7.4.230.0000.00716.91
7.4.220.0070.01116.67
7.4.210.0080.00816.83
7.4.200.0070.00016.61
7.4.190.0070.00016.88
7.4.160.0030.01316.89
7.4.150.0090.01217.40
7.4.140.0080.00917.86
7.4.130.0120.00616.83
7.4.120.0100.00716.75
7.4.110.0000.01716.65
7.4.100.0090.00916.87
7.4.90.0060.01216.68
7.4.80.0000.01619.39
7.4.70.0130.00316.84
7.4.60.0110.00616.69
7.4.50.0050.00316.55
7.4.40.0120.00622.77
7.4.30.0060.00916.63
7.4.00.0040.01115.23
7.3.330.0000.00613.48
7.3.320.0000.00613.38
7.3.310.0030.00316.40
7.3.300.0040.00416.52
7.3.290.0080.00716.52
7.3.280.0080.00916.49
7.3.270.0100.00717.40
7.3.260.0060.01216.67
7.3.250.0100.01116.62
7.3.240.0060.01116.58
7.3.230.0070.01016.55
7.3.210.0110.00616.48
7.3.200.0120.00919.39
7.3.190.0080.01516.68
7.3.180.0100.00716.57
7.3.170.0080.00916.73
7.3.160.0080.00816.47
7.3.120.0080.00815.13
7.3.10.0230.00516.84
7.3.00.0110.01516.23
7.2.330.0100.00716.74
7.2.320.0030.01616.82
7.2.310.0070.01016.90
7.2.300.0070.01016.71
7.2.290.0140.00316.80
7.2.130.0260.00316.67
7.2.120.0190.00616.74
7.2.110.0220.00416.64
7.2.100.0210.00816.71
7.2.90.0130.00516.74
7.2.80.0180.00916.38
7.2.70.0210.01116.78
7.2.60.0100.01016.64
7.2.50.0140.00916.55
7.2.40.0150.00916.89
7.2.30.0220.00717.16
7.2.20.0210.00416.91
7.2.10.0150.00916.93
7.2.00.0110.00618.15
7.1.250.0180.01115.50
7.1.200.0030.01015.99
7.1.100.0000.00818.03
7.1.70.0000.01017.38
7.1.60.0100.01619.82
7.1.50.0060.01517.32
7.1.00.0000.08022.50
7.0.200.0040.00716.93
7.0.140.0000.07322.09
7.0.60.0030.04020.05
7.0.50.0030.06317.90
7.0.40.0070.05720.22
7.0.30.0370.07320.27
7.0.20.0200.06020.25
7.0.10.0300.07320.19
7.0.00.0130.04720.27
5.6.280.0030.07321.08
5.6.210.0100.07720.57
5.6.200.0130.07318.29
5.6.190.0130.07720.47
5.6.180.3370.04720.49
5.6.170.0300.07020.56
5.6.160.0070.08720.44
5.6.150.0100.07718.16
5.6.140.0100.07318.14
5.6.130.0070.07318.14
5.6.120.0100.07721.04
5.6.110.0100.08321.13
5.6.100.0070.08021.00
5.6.90.0070.06021.10
5.6.80.0130.06720.37
5.5.350.0170.04720.38
5.5.340.0030.06317.92
5.5.330.0030.04320.31
5.5.320.0270.03320.38
5.5.310.0200.04320.50
5.5.300.0070.07017.92
5.5.290.0170.07017.95
5.5.280.0070.08020.78
5.5.270.0000.04320.73
5.5.260.0070.08720.87
5.5.250.0030.07320.80
5.5.240.0130.03320.16
5.4.450.0330.05319.48
5.4.440.0170.05019.60
5.4.430.1070.00019.44
5.4.420.0730.00019.44
5.4.410.0100.06018.70
5.4.400.0230.04318.79
5.4.390.0170.04318.83
5.4.380.0200.06018.46
5.4.370.0300.05318.61
5.4.360.0200.05018.48
5.4.350.0230.04718.50
5.4.340.0230.06018.53
5.4.320.0070.04012.50
5.4.310.0050.03812.50
5.4.300.0060.03912.50
5.4.290.0080.03512.50
5.4.280.0050.03612.39
5.4.270.0230.05718.90
5.4.260.0230.05719.15
5.4.250.0170.05318.96
5.4.240.0070.08018.99
5.4.230.0030.07318.82
5.4.220.0100.07319.03
5.4.210.0170.04719.05
5.4.200.0100.07718.82
5.4.190.0070.08019.10
5.4.180.0170.04719.16
5.4.170.0100.07318.86
5.4.160.0070.06718.91
5.4.150.0230.05719.15
5.4.140.0200.05716.67
5.4.130.0170.05016.72
5.4.120.0130.06716.75
5.4.110.0130.05316.54
5.4.100.0200.05716.62
5.4.90.0100.05716.62
5.4.80.0170.06316.38
5.4.70.0130.05716.56
5.4.60.0200.05316.61
5.4.50.0170.04716.43
5.4.40.0170.05316.72
5.4.30.0130.06316.54
5.4.20.0200.06716.53
5.4.10.0100.06016.58
5.4.00.0200.06016.06
5.3.290.0080.04212.80
5.3.280.0100.05714.67
5.3.270.0100.05714.79
5.3.260.0130.07714.91
5.3.250.0170.06314.67
5.3.240.0070.07314.67
5.3.230.0130.06014.67
5.3.220.0200.04314.63
5.3.210.0170.06314.63
5.3.200.0070.05714.65
5.3.190.0170.06714.86
5.3.180.0100.06014.63
5.3.170.0130.05314.86
5.3.160.0030.06014.77
5.3.150.0330.07014.63
5.3.140.0170.07014.86
5.3.130.0100.06314.85
5.3.120.0030.08714.83
5.3.110.0000.07314.84
5.3.100.0170.06714.22
5.3.90.0130.05314.07
5.3.80.0130.06314.24
5.3.70.0100.07014.32
5.3.60.0130.05314.29
5.3.50.0270.05314.22
5.3.40.0070.05714.07
5.3.30.0130.06714.14
5.3.20.0170.06013.75
5.3.10.0070.07313.77
5.3.00.0130.06013.85
5.2.170.0200.04711.36
5.2.160.0130.04011.39
5.2.150.0170.05011.37
5.2.140.0170.05311.38
5.2.130.0170.05011.41
5.2.120.0130.03711.32
5.2.110.0070.04711.30
5.2.100.0030.05011.33
5.2.90.0100.04311.38
5.2.80.0130.03711.13
5.2.70.0030.06010.98
5.2.60.0130.04711.24
5.2.50.0100.05011.25
5.2.40.0030.04711.27
5.2.30.0030.04711.16
5.2.20.0030.05711.15
5.2.10.0070.05710.92
5.2.00.0000.05310.95
5.1.60.0070.0479.89
5.1.50.0070.03310.24
5.1.40.0030.03710.27
5.1.30.0070.05310.55
5.1.20.0200.04010.44
5.1.10.0000.04010.14
5.1.00.0100.03010.34
5.0.50.0070.0278.54
5.0.40.0030.0378.64
5.0.30.0100.0408.43
5.0.20.0070.0278.50
5.0.10.0030.0308.41
5.0.00.0030.0438.43
4.4.90.0070.0307.66
4.4.80.0000.0307.66
4.4.70.0000.0237.66
4.4.60.0000.0237.66
4.4.50.0030.0307.66
4.4.40.0030.0437.66
4.4.30.0030.0277.66
4.4.20.0030.0277.66
4.4.10.0070.0237.66
4.4.00.0000.0377.66
4.3.110.0030.0337.66
4.3.100.0070.0277.66
4.3.90.0000.0237.66
4.3.80.0030.0437.66
4.3.70.0000.0337.66
4.3.60.0070.0207.66
4.3.50.0070.0207.66
4.3.40.0000.0377.66
4.3.30.0000.0337.66
4.3.20.0070.0207.66
4.3.10.0000.0277.66
4.3.00.0030.0236.47

preferences:
74.45 ms | 401 KiB | 5 Q