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)) { $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.0120.00918.39
8.3.50.0110.00822.05
8.3.40.0120.00319.04
8.3.30.0070.01419.08
8.3.20.0040.00420.16
8.3.10.0090.00022.10
8.3.00.0040.00422.44
8.2.180.0190.00317.00
8.2.170.0130.00322.96
8.2.160.0090.00620.91
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00319.61
8.2.110.0060.00322.44
8.2.100.0120.00019.89
8.2.90.0080.00019.26
8.2.80.0060.00618.16
8.2.70.0000.00817.88
8.2.60.0050.00317.93
8.2.50.0030.00518.07
8.2.40.0000.00918.20
8.2.30.0000.00718.05
8.2.20.0000.00817.87
8.2.10.0080.00017.88
8.2.00.0040.00417.99
8.1.280.0060.01225.92
8.1.270.0040.00421.98
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0040.00423.80
8.1.230.0060.00919.00
8.1.220.0080.00017.91
8.1.210.0040.00418.77
8.1.200.0090.00017.25
8.1.190.0060.00317.40
8.1.180.0080.00018.10
8.1.170.0030.00518.82
8.1.160.0000.00821.98
8.1.150.0000.00818.78
8.1.140.0000.00717.57
8.1.130.0040.00417.94
8.1.120.0040.00417.59
8.1.110.0040.00417.56
8.1.100.0000.00717.44
8.1.90.0000.00717.54
8.1.80.0060.00317.63
8.1.70.0030.00317.57
8.1.60.0030.00617.67
8.1.50.0040.00417.64
8.1.40.0000.00817.55
8.1.30.0030.00617.73
8.1.20.0040.00417.70
8.1.10.0070.00017.64
8.1.00.0080.00017.54
8.0.300.0070.00018.77
8.0.290.0040.00417.30
8.0.280.0000.00818.42
8.0.270.0070.00017.39
8.0.260.0040.00416.94
8.0.250.0070.00017.19
8.0.240.0050.00217.08
8.0.230.0030.00317.13
8.0.220.0070.00017.09
8.0.210.0000.00717.04
8.0.200.0030.00317.15
8.0.190.0040.00417.11
8.0.180.0050.00317.14
8.0.170.0000.00717.00
8.0.160.0040.00417.07
8.0.150.0050.00317.08
8.0.140.0040.00416.95
8.0.130.0000.00513.57
8.0.120.0040.00417.06
8.0.110.0000.00716.98
8.0.100.0070.00016.96
8.0.90.0040.00417.09
8.0.80.0090.00617.13
8.0.70.0040.00417.13
8.0.60.0040.00417.09
8.0.50.0040.00417.07
8.0.30.0090.01417.29
8.0.20.0120.00617.46
8.0.10.0000.00817.18
8.0.00.0130.00416.69
7.4.330.0000.00515.04
7.4.320.0000.00716.68
7.4.300.0030.00316.69
7.4.290.0030.00316.79
7.4.280.0000.00716.75
7.4.270.0000.00716.83
7.4.260.0030.00316.70
7.4.250.0040.00416.60
7.4.240.0020.00516.70
7.4.230.0020.00516.88
7.4.220.0030.01516.86
7.4.210.0080.00916.85
7.4.200.0030.00316.83
7.4.190.0030.00516.74
7.4.160.0090.00916.72
7.4.150.0070.01117.40
7.4.140.0120.00517.86
7.4.130.0150.00916.70
7.4.120.0140.00316.68
7.4.110.0040.01516.66
7.4.100.0100.01316.82
7.4.90.0120.00616.76
7.4.80.0120.01119.39
7.4.70.0030.01216.66
7.4.60.0110.01116.78
7.4.50.0030.00616.77
7.4.40.0120.00322.77
7.4.30.0100.00616.77
7.4.10.0130.00715.11
7.4.00.0050.01215.24
7.3.330.0030.00313.32
7.3.320.0030.00313.34
7.3.310.0000.00716.55
7.3.300.0000.00716.50
7.3.290.0170.00316.46
7.3.280.0110.00516.47
7.3.270.0100.01017.40
7.3.260.0120.00916.58
7.3.250.0100.01016.59
7.3.240.0070.01016.80
7.3.230.0040.01316.57
7.3.210.0040.01616.64
7.3.200.0040.01719.39
7.3.190.0150.00616.69
7.3.180.0180.00016.70
7.3.170.0080.00816.84
7.3.160.0060.01016.63
7.3.130.0120.00615.23
7.3.120.0070.01014.82
7.3.110.0100.00715.09
7.3.100.0070.01015.06
7.3.90.0060.00614.97
7.3.80.0010.01314.77
7.3.70.0030.01415.09
7.3.60.0050.00915.01
7.3.50.0040.00914.83
7.3.40.0090.00715.05
7.3.30.0070.00915.05
7.3.20.0080.00616.86
7.3.10.0020.01316.91
7.3.00.0080.00916.83
7.2.330.0100.00716.90
7.2.320.0190.00616.71
7.2.310.0130.00316.73
7.2.300.0100.00716.80
7.2.290.0060.01216.84
7.2.260.0070.01315.19
7.2.250.0070.01215.25
7.2.240.0040.01415.19
7.2.230.0060.01015.24
7.2.220.0040.01015.03
7.2.210.0070.00815.25
7.2.200.0080.01015.21
7.2.190.0050.01115.09
7.2.180.0080.00515.25
7.2.170.0060.01015.12
7.2.160.0070.00715.23
7.2.150.0040.00816.98
7.2.140.0040.01217.17
7.2.130.0090.00317.02
7.2.120.0000.01017.23
7.2.110.0030.01017.14
7.2.100.0030.01417.13
7.2.90.0060.00617.15
7.2.80.0060.00617.16
7.2.70.0110.00716.88
7.2.60.0030.00917.13
7.2.50.0040.00817.06
7.2.40.0090.00616.85
7.2.30.0040.01117.03
7.2.20.0080.00616.84
7.2.10.0070.00717.00
7.2.00.0140.01018.31
7.1.330.0070.00816.04
7.1.320.0090.00615.96
7.1.310.0030.01316.01
7.1.300.0070.00616.07
7.1.290.0100.00615.96
7.1.280.0070.00915.80
7.1.270.0060.00816.01
7.1.260.0070.00515.79
7.1.250.0030.01016.11
7.1.240.0030.01016.09
7.1.230.0060.00615.69
7.1.220.0060.00915.97
7.1.210.0000.01215.96
7.1.200.0070.00615.80
7.1.190.0080.00416.13
7.1.180.0060.00615.93
7.1.170.0100.00315.87
7.1.160.0000.01016.13
7.1.150.0060.00315.94
7.1.140.0040.00815.96
7.1.130.0040.01215.78
7.1.120.0070.00715.94
7.1.110.0000.01015.75
7.1.100.0030.00917.08
7.1.90.0080.00816.05
7.1.80.0070.00716.14
7.1.70.0040.00716.64
7.1.60.0070.01017.94
7.1.50.0080.00816.45
7.1.40.0100.00715.79
7.1.30.0040.00815.86
7.1.20.0000.01315.95
7.1.10.0030.01016.06
7.1.00.0020.04619.16
7.0.330.0040.00815.49
7.0.320.0060.00915.64
7.0.310.0090.00615.45
7.0.300.0030.01115.73
7.0.290.0050.00515.39
7.0.280.0030.00915.66
7.0.270.0110.00415.64
7.0.260.0000.01515.59
7.0.250.0070.00315.40
7.0.240.0080.00015.69
7.0.230.0070.00715.60
7.0.220.0060.00315.70
7.0.210.0070.00715.73
7.0.200.0040.00916.19
7.0.190.0090.00615.25
7.0.180.0110.00315.54
7.0.170.0000.01115.60
7.0.160.0000.01315.59
7.0.150.0000.01215.79
7.0.140.0020.04018.86
7.0.130.0080.00315.55
7.0.120.0060.00615.57
7.0.110.0040.01115.09
7.0.100.0090.00615.64
7.0.90.0040.00715.55
7.0.80.0040.00815.65
7.0.70.0040.00715.72
7.0.60.0030.04817.76
7.0.50.0000.02816.61
7.0.40.0020.03816.96
7.0.30.0210.04116.78
7.0.20.0100.02916.83
7.0.10.0140.02516.78
7.0.00.0050.02516.83
5.6.400.0060.00314.42
5.6.390.0090.00614.65
5.6.380.0080.00814.54
5.6.370.0070.00714.65
5.6.360.0000.01514.12
5.6.350.0130.00014.48
5.6.340.0100.00314.64
5.6.330.0070.01014.68
5.6.320.0040.00714.84
5.6.310.0070.01014.89
5.6.300.0030.01014.09
5.6.290.0040.00814.43
5.6.280.0070.04017.59
5.6.270.0060.00314.56
5.6.260.0000.00814.52
5.6.250.0030.01014.15
5.6.240.0040.00714.41
5.6.230.0050.00514.52
5.6.220.0070.01014.02
5.6.210.0050.04617.42
5.6.200.0010.02616.20
5.6.190.0000.03017.37
5.6.180.1670.02217.54
5.6.170.0100.03117.43
5.6.160.0030.03317.42
5.6.150.0060.04416.29
5.6.140.0000.02716.40
5.6.130.0040.04616.29
5.6.120.0150.04017.66
5.6.110.0050.02617.76
5.6.100.0080.03817.69
5.6.90.0030.05017.68
5.6.80.0140.03417.38
5.6.70.0200.04217.43
5.6.60.0040.00714.18
5.6.50.0100.00014.07
5.6.40.0060.00914.23
5.6.30.0000.00814.23
5.6.20.0080.00614.23
5.6.10.0070.00714.52
5.6.00.0090.00614.39
5.5.380.0030.00614.17
5.5.370.0060.00914.32
5.5.360.0070.01014.23
5.5.350.0070.04817.31
5.5.340.0100.03816.13
5.5.330.0070.02317.43
5.5.320.0260.03217.29
5.5.310.0180.04017.22
5.5.300.0080.04516.07
5.5.290.0040.03416.19
5.5.280.0040.02917.48
5.5.270.0110.04317.67
5.5.260.0120.03217.60
5.5.250.0070.04717.40
5.5.240.0070.04317.09
5.5.230.0070.01014.43
5.5.220.0070.00714.41
5.5.210.0060.00914.29
5.5.200.0090.00414.23
5.5.190.0000.01214.23
5.5.180.0100.00314.30
5.5.170.0000.01313.84
5.5.160.0090.00314.14
5.5.150.0090.00314.16
5.5.140.0070.00714.07
5.5.130.0080.00414.20
5.5.120.0030.01214.52
5.5.110.0100.00314.32
5.5.100.0000.01114.21
5.5.90.0000.01314.13
5.5.80.0030.01414.20
5.5.70.0000.01314.59
5.5.60.0060.00614.52
5.5.50.0080.00413.93
5.5.40.0000.01114.03
5.5.30.0000.01814.00
5.5.20.0040.00814.21
5.5.10.0000.01514.28
5.5.00.0000.01314.15
5.4.450.1400.03115.43
5.4.440.1320.02915.27
5.4.430.1300.01815.20
5.4.420.1570.02715.27
5.4.410.1310.02615.31
5.4.400.1320.02415.10
5.4.390.1350.03015.12
5.4.380.0050.03015.27
5.4.370.0050.02315.11
5.4.360.0420.02315.28
5.4.350.1300.02015.18
5.4.340.1590.02515.22
5.4.330.0040.00411.31
5.4.320.1420.02215.28
5.4.310.1420.02415.23
5.4.300.1300.02515.11
5.4.290.1350.02015.22
5.4.280.1520.02615.26
5.4.270.1380.02015.17
5.4.260.1300.01615.26
5.4.250.1370.02115.25
5.4.240.1470.02215.19
5.4.230.1350.02115.19
5.4.220.1530.02715.20
5.4.210.1470.01715.19
5.4.200.1450.02215.12
5.4.190.1480.02315.19
5.4.180.1450.02515.18
5.4.170.1470.02315.20
5.4.160.1360.01515.18
5.4.150.1450.02315.05
5.4.140.1310.02113.85
5.4.130.1320.02013.94
5.4.120.1440.02213.89
5.4.110.1330.02013.88
5.4.100.1450.02313.92
5.4.90.0100.01713.89
5.4.80.0070.02413.76
5.4.70.0650.02913.84
5.4.60.1390.02513.74
5.4.50.1470.02213.81
5.4.40.1560.02313.87
5.4.30.1400.01613.89
5.4.20.1530.02313.83
5.4.10.1470.01813.83
5.4.00.1350.02013.59
5.3.290.1510.02912.96
5.3.280.1420.02012.87
5.3.270.1270.02512.97
5.3.260.1330.01812.88
5.3.250.1200.02512.97
5.3.240.1380.02712.88
5.3.230.0030.03112.95
5.3.220.0060.02312.99
5.3.210.0040.02512.97
5.3.200.0710.01812.86
5.3.190.1310.01912.92
5.3.180.1380.02512.87
5.3.170.0050.02812.88
5.3.160.0020.02512.94
5.3.150.0580.02512.93
5.3.140.1300.02412.86
5.3.130.1390.01812.85
5.3.120.1220.02312.84
5.3.110.1430.02012.87
5.3.100.1580.02312.65
5.3.90.1370.02512.59
5.3.80.1450.01512.61
5.3.70.1330.01912.56
5.3.60.1560.02112.65
5.3.50.1350.02312.64
5.3.40.1240.02312.66
5.3.30.1380.01812.59
5.3.20.1400.02012.42
5.3.10.1380.02012.42
5.3.00.1370.01712.46
5.2.170.2130.03011.07
5.2.160.2500.03711.23
5.2.150.2170.02711.11
5.2.140.2200.02311.17
5.2.130.2270.02311.29
5.2.120.2230.02711.04
5.2.110.2770.02711.06
5.2.100.2300.02310.96
5.2.90.2130.02710.96
5.2.80.2530.03011.02
5.2.70.2100.03311.05
5.2.60.2030.03311.23
5.2.50.0000.03010.98
5.2.40.0070.03010.86
5.2.30.0000.06311.04
5.2.20.0000.03711.13
5.2.10.0600.05311.01
5.2.00.1970.03310.80
5.1.60.2000.0279.88
5.1.50.2030.0239.99
5.1.40.1970.0339.89
5.1.30.1030.03710.42
5.1.20.0000.03310.32
5.1.10.0030.02710.06
5.1.00.0030.02310.01
5.0.50.0030.0208.54
5.0.40.0200.0208.55
5.0.30.0470.0308.25
5.0.20.1100.0278.11
5.0.10.1000.0208.08
5.0.00.0870.0308.16
4.4.90.0930.0177.90
4.4.80.1070.0177.90
4.4.70.0900.0137.90
4.4.60.0970.0177.90
4.4.50.0900.0177.90
4.4.40.1070.0377.90
4.4.30.0930.0137.90
4.4.20.1030.0177.90
4.4.10.0930.0177.90
4.4.00.1070.0337.90
4.3.110.1100.0207.90
4.3.100.1100.0137.90
4.3.90.0970.0177.90
4.3.80.1000.0207.90
4.3.70.0930.0137.90
4.3.60.0870.0137.90
4.3.50.1100.0207.90
4.3.40.1100.0207.90
4.3.30.0530.0137.90
4.3.20.0630.0277.90
4.3.10.0600.0177.90
4.3.00.0530.0137.90

preferences:
44.64 ms | 401 KiB | 5 Q