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); } 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.0070.01118.31
8.3.50.0120.00522.03
8.3.40.0180.00418.92
8.3.30.0100.00618.96
8.3.20.0090.00018.98
8.3.10.0030.00620.61
8.3.00.0070.00717.71
8.2.180.0120.00617.00
8.2.170.0120.00322.96
8.2.160.0090.00622.42
8.2.150.0070.01124.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0040.00420.07
8.2.110.0030.00620.41
8.2.100.0080.00318.16
8.2.90.0000.00918.34
8.2.80.0000.00917.97
8.2.70.0110.00017.88
8.2.60.0110.00417.63
8.2.50.0080.00018.07
8.2.40.0040.00418.47
8.2.30.0040.00419.73
8.2.20.0000.00817.84
8.2.10.0000.00817.89
8.2.00.0050.00317.94
8.1.280.0090.00625.92
8.1.270.0030.00522.14
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00422.17
8.1.230.0070.00421.00
8.1.220.0050.00317.79
8.1.210.0040.00418.93
8.1.200.0090.00017.48
8.1.190.0000.00717.41
8.1.180.0030.00518.10
8.1.170.0000.00818.75
8.1.160.0030.00618.84
8.1.150.0050.00318.64
8.1.140.0050.00317.55
8.1.130.0000.00717.91
8.1.120.0000.00717.67
8.1.110.0040.00417.62
8.1.100.0040.00417.57
8.1.90.0090.00017.55
8.1.80.0040.00417.63
8.1.70.0000.00717.46
8.1.60.0040.00417.67
8.1.50.0030.00617.61
8.1.40.0000.00917.60
8.1.30.0000.00817.66
8.1.20.0060.00317.64
8.1.10.0000.00817.79
8.1.00.0030.00617.71
8.0.300.0050.00320.22
8.0.290.0000.00716.71
8.0.280.0070.00018.50
8.0.270.0000.00717.30
8.0.260.0030.00317.07
8.0.250.0050.00317.08
8.0.240.0040.00717.07
8.0.230.0000.00817.01
8.0.220.0030.00317.03
8.0.210.0030.00616.97
8.0.200.0030.00317.12
8.0.190.0050.00217.09
8.0.180.0040.00417.04
8.0.170.0040.00417.04
8.0.160.0040.00417.11
8.0.150.0000.00916.92
8.0.140.0040.00416.96
8.0.130.0050.00013.42
8.0.120.0030.00616.87
8.0.110.0040.00417.06
8.0.100.0000.00716.82
8.0.90.0040.00417.02
8.0.80.0040.01117.07
8.0.70.0000.00716.89
8.0.60.0040.00417.04
8.0.50.0040.00416.98
8.0.30.0120.00717.22
8.0.20.0100.00917.40
8.0.10.0080.00017.04
8.0.00.0100.01016.90
7.4.330.0050.00014.96
7.4.320.0030.00316.79
7.4.300.0030.00316.69
7.4.290.0040.00416.72
7.4.280.0000.00816.69
7.4.270.0000.00716.69
7.4.260.0050.00013.53
7.4.250.0040.00416.77
7.4.240.0000.00716.75
7.4.230.0040.00416.75
7.4.220.0100.01016.73
7.4.210.0080.00816.77
7.4.200.0000.00716.89
7.4.190.0000.00716.95
7.4.160.0030.01216.82
7.4.150.0090.00917.40
7.4.140.0080.01017.29
7.4.130.0120.00816.63
7.4.120.0110.00916.78
7.4.110.0060.01516.81
7.4.100.0150.00316.78
7.4.90.0120.00616.65
7.4.80.0070.01019.03
7.4.70.0060.01916.80
7.4.60.0090.00616.83
7.4.50.0060.00016.68
7.4.40.0090.00622.27
7.4.30.0040.01216.63
7.4.10.0090.00915.09
7.4.00.0070.01015.14
7.3.330.0050.00013.28
7.3.320.0060.00013.13
7.3.310.0030.00316.56
7.3.300.0030.00316.44
7.3.290.0090.00616.44
7.3.280.0080.01116.40
7.3.270.0030.01317.40
7.3.260.0110.01118.24
7.3.250.0060.01616.70
7.3.240.0100.00616.39
7.3.230.0060.01216.77
7.3.210.0090.00916.55
7.3.200.0000.01719.39
7.3.190.0040.01516.82
7.3.180.0090.00916.64
7.3.170.0130.01016.73
7.3.160.0090.00616.66
7.3.130.0070.01215.11
7.3.120.0060.01114.92
7.3.110.0070.01114.96
7.3.100.0100.00515.00
7.3.90.0080.00714.93
7.3.80.0060.00915.02
7.3.70.0080.00614.96
7.3.60.0050.00615.06
7.3.50.0090.00614.86
7.3.40.0020.01115.00
7.3.30.0040.01115.00
7.3.20.0080.00816.70
7.3.10.0080.00716.83
7.3.00.0080.00716.90
7.2.330.0090.00916.66
7.2.320.0130.01016.59
7.2.310.0070.01116.69
7.2.300.0040.01316.87
7.2.290.0100.01116.75
7.2.260.0070.01015.27
7.2.250.0080.01015.21
7.2.240.0040.01015.19
7.2.230.0050.00915.32
7.2.220.0100.00515.26
7.2.210.0060.00715.23
7.2.200.0050.00915.22
7.2.190.0060.01015.10
7.2.180.0060.00915.18
7.2.170.0030.01015.22
7.2.160.0030.01015.12
7.2.150.0050.00917.08
7.2.140.0040.01017.02
7.2.130.0070.00816.97
7.2.120.0090.00517.02
7.2.110.0060.00916.99
7.2.100.0070.00717.07
7.2.90.0070.00816.96
7.2.80.0060.00916.95
7.2.70.0030.00917.12
7.2.60.0070.00817.04
7.2.50.0050.00917.12
7.2.40.0070.00816.89
7.2.30.0090.00916.92
7.2.20.0040.00917.12
7.2.10.0050.01017.02
7.2.00.0070.00617.11
7.1.330.0020.01315.99
7.1.320.0050.00616.06
7.1.310.0060.00915.86
7.1.300.0050.00915.91
7.1.290.0050.00615.95
7.1.280.0030.00815.98
7.1.270.0050.00915.94
7.1.260.0070.00516.03
7.1.250.0060.00915.89
7.1.240.0050.01015.90
7.1.230.0080.00415.96
7.1.220.0060.00915.93
7.1.210.0030.01016.05
7.1.200.0070.00615.93
7.1.190.0030.00915.96
7.1.180.0050.00716.03
7.1.170.0030.00916.01
7.1.160.0040.00916.02
7.1.150.0070.00815.94
7.1.140.0070.00715.93
7.1.130.0040.00915.96
7.1.120.0030.00915.90
7.1.110.0050.00816.00
7.1.100.0050.00815.81
7.1.90.0060.00816.05
7.1.80.0030.00716.09
7.1.70.0060.00716.31
7.1.60.0060.01116.71
7.1.50.0080.00416.18
7.1.40.0050.00715.97
7.1.30.0060.00715.86
7.1.20.0070.00715.92
7.1.10.0060.00715.86
7.1.00.0060.02017.17
7.0.330.0060.00815.51
7.0.320.0030.00915.46
7.0.310.0040.00915.63
7.0.300.0040.01015.54
7.0.290.0050.00815.55
7.0.280.0070.00515.67
7.0.270.0050.00715.59
7.0.260.0060.00815.60
7.0.250.0040.00815.50
7.0.240.0050.00815.58
7.0.230.0040.00915.48
7.0.220.0080.00515.56
7.0.210.0050.00515.61
7.0.200.0060.00615.71
7.0.190.0060.00615.53
7.0.180.0050.00415.72
7.0.170.0070.00515.59
7.0.160.0050.00815.50
7.0.150.0060.00915.51
7.0.140.0050.02216.97
7.0.130.0050.00715.58
7.0.120.0050.00815.59
7.0.110.0020.01616.47
7.0.100.0070.01216.41
7.0.90.0060.01616.49
7.0.80.0040.01616.34
7.0.70.0030.02316.45
7.0.60.0060.02316.40
7.0.50.0080.02216.41
7.0.40.0040.02014.84
7.0.30.0070.01914.79
7.0.20.0070.02214.87
7.0.10.0070.02314.76
7.0.00.0050.01514.87
5.6.400.0040.00914.37
5.6.390.0060.00714.64
5.6.380.0060.00614.28
5.6.370.0030.01014.43
5.6.360.0040.00814.59
5.6.350.0070.00514.63
5.6.340.0060.00714.38
5.6.330.0040.00914.67
5.6.320.0060.00914.57
5.6.310.0030.01214.58
5.6.300.0070.00614.51
5.6.290.0050.00814.62
5.6.280.0050.02115.89
5.6.270.0100.00314.67
5.6.260.0030.01415.71
5.6.250.0050.01315.74
5.6.240.0050.02315.75
5.6.230.0040.01515.71
5.6.220.0070.02215.67
5.6.210.0040.01615.60
5.6.200.0060.01915.77
5.6.190.0060.02315.58
5.6.180.0060.02315.66
5.6.170.0060.02415.70
5.6.160.0090.01615.69
5.6.150.0070.01715.67
5.6.140.0050.02115.69
5.6.130.0050.02015.73
5.6.120.0080.01815.80
5.6.110.0090.01415.66
5.6.100.0070.01415.72
5.6.90.0050.02315.68
5.6.80.0020.02515.52
5.6.70.0060.02315.48
5.6.60.0090.01715.44
5.6.50.0060.02315.62
5.6.40.0050.02015.47
5.6.30.0060.02315.50
5.6.20.0090.02015.54
5.6.10.0050.02315.58
5.6.00.0070.01415.47
5.5.380.0060.01415.58
5.5.370.0060.01215.57
5.5.360.0050.01715.66
5.5.350.0070.02215.41
5.5.340.0090.01415.72
5.5.330.0090.02015.72
5.5.320.0080.02315.73
5.5.310.0060.01615.77
5.5.300.0050.02115.68
5.5.290.0080.02215.64
5.5.280.0060.02315.89
5.5.270.0090.02115.76
5.5.260.0060.02115.83
5.5.250.0030.02715.67
5.5.240.0060.02115.48
5.5.230.0070.02015.53
5.5.220.0050.02115.57
5.5.210.0070.02115.33
5.5.200.0080.01915.54
5.5.190.0070.02015.51
5.5.180.0060.02215.53
5.5.170.0090.00414.42
5.5.160.0080.01415.46
5.5.150.0080.02115.45
5.5.140.0110.01815.43
5.5.130.0070.02115.50
5.5.120.0060.02215.47
5.5.110.0080.01815.43
5.5.100.0030.02015.41
5.5.90.0040.02315.55
5.5.80.0070.02215.50
5.5.70.0050.02015.51
5.5.60.0060.02015.54
5.5.50.0080.01215.45
5.5.40.0060.02215.48
5.5.30.0050.02015.48
5.5.20.0080.02015.46
5.5.10.0080.01815.42
5.5.00.0090.01915.55
5.4.450.0030.01513.25
5.4.440.0050.01813.20
5.4.430.0040.02013.22
5.4.420.0070.02013.09
5.4.410.0060.01313.13
5.4.400.0060.01713.05
5.4.390.0070.01613.12
5.4.380.0020.02313.07
5.4.370.0070.01713.11
5.4.360.0060.02013.12
5.4.350.0050.01813.06
5.4.340.0030.01513.11
5.4.330.0040.00611.56
5.4.320.0050.01812.97
5.4.310.0020.02113.03
5.4.300.0100.01413.05
5.4.290.0070.01913.11
5.4.280.0060.01712.98
5.4.270.0030.02213.10
5.4.260.0040.01413.09
5.4.250.0040.01813.03
5.4.240.0050.01913.13
5.4.230.0050.01412.98
5.4.220.0020.02213.09
5.4.210.0040.02013.12
5.4.200.0040.01513.13
5.4.190.0050.02013.06
5.4.180.0070.01913.11
5.4.170.0030.02113.08
5.4.160.0070.01813.07
5.4.150.0030.02112.99
5.4.140.0050.01912.58
5.4.130.0030.02012.55
5.4.120.0050.01712.47
5.4.110.0050.02012.49
5.4.100.0060.01612.50
5.4.90.0050.01712.40
5.4.80.0060.02012.49
5.4.70.0060.01412.53
5.4.60.0040.01712.58
5.4.50.0020.01912.61
5.4.40.0050.01912.58
5.4.30.0030.02212.60
5.4.20.0060.01312.55
5.4.10.0040.02112.55
5.4.00.0040.01912.34
5.3.290.0060.02012.02
5.3.280.0030.01412.01
5.3.270.0080.01812.03
5.3.260.0040.02111.99
5.3.250.0050.01911.97
5.3.240.0030.01611.97
5.3.230.0040.01612.00
5.3.220.0050.01511.97
5.3.210.0050.01711.99
5.3.200.0040.01811.94
5.3.190.0040.02012.02
5.3.180.0030.01912.02
5.3.170.0030.02111.99
5.3.160.0050.01912.02
5.3.150.0050.01812.04
5.3.140.0050.01512.00
5.3.130.0070.01711.96
5.3.120.0050.01911.97
5.3.110.0040.02211.96
5.3.100.0070.01911.88
5.3.90.0040.01911.88
5.3.80.0020.02211.86
5.3.70.0030.01811.85
5.3.60.0040.01911.84
5.3.50.0040.01811.85
5.3.40.0040.01411.87
5.3.30.0040.01911.83
5.3.20.0040.02011.77
5.3.10.0050.01711.77
5.3.00.0020.02011.79
5.2.170.0030.06311.95
5.2.160.0070.07311.95
5.2.150.0070.06311.95
5.2.140.0070.06011.95
5.2.130.0030.06011.95
5.2.120.0070.05711.95
5.2.110.0070.03311.95
5.2.100.0070.05011.95
5.2.90.0070.05711.95
5.2.80.0130.05711.95
5.2.70.0000.06711.95
5.2.60.0100.05711.95
5.2.50.0070.06311.95
5.2.40.0030.06711.95
5.2.30.0000.04011.95
5.2.20.0100.05711.95
5.2.10.0030.05711.95
5.2.00.0000.06311.95
5.1.60.0070.05011.95
5.1.50.0000.05711.95
5.1.40.0100.04711.95
5.1.30.0100.05011.95
5.1.20.0070.05311.95
5.1.10.0100.05011.95
5.1.00.0070.02711.95
5.0.50.0070.04711.95
5.0.40.0030.04311.95
5.0.30.0030.07011.95
5.0.20.0030.03711.95
5.0.10.0000.03711.95
5.0.00.0000.06311.95
4.4.90.0030.03311.95
4.4.80.0000.03711.95
4.4.70.0030.03311.95
4.4.60.0000.04011.95
4.4.50.0000.03311.95
4.4.40.0030.05311.95
4.4.30.0030.02711.95
4.4.20.0070.03011.95
4.4.10.0000.02311.95
4.4.00.0070.05011.95
4.3.110.0000.03311.95
4.3.100.0000.03711.95
4.3.90.0000.03711.95
4.3.80.0000.05311.95
4.3.70.0070.03011.95
4.3.60.0000.03311.95
4.3.50.0030.03311.95
4.3.40.0000.05311.95
4.3.30.0000.03311.95
4.3.20.0030.03311.95
4.3.10.0030.03311.95
4.3.00.0000.01711.95

preferences:
32.77 ms | 401 KiB | 5 Q