3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_lines = 'This is a test for<img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Girl">my <img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Girl">regex which<img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Girl">should be alright <img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Not-Talking">and<img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Not-Talking"> match all this emoticons except things like <img dsopjfdojp <img oew> because this ones are not real emoticons! The following is a real one: <img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" class="emoticon Girl">'; $doc = new DOMDocument(); // Suppress warnings @$doc->loadHTML($input_lines); $imgs = $doc->getElementsByTagName("img"); $number_of_imgs = $imgs->length; echo "Found $number_of_imgs images" . PHP_EOL; // The plain text is actually the nodeValue of // the whole snippet. $text = $imgs->item(0)->parentNode->nodeValue; $len = mb_strlen($text); echo "Text length: $len + $number_of_imgs(images)" . PHP_EOL;

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.5.10.0090.00820.50
8.5.00.0110.01020.32
8.4.160.0120.01126.02
8.4.150.0030.00014.05
8.4.140.0140.01018.16
8.4.130.0120.00917.91
8.4.120.0110.00920.71
8.4.110.0030.00622.65
8.4.100.0120.00918.44
8.4.90.0120.00920.99
8.4.80.0130.00818.91
8.4.70.0060.00218.34
8.4.60.0070.00718.93
8.4.50.0100.00919.19
8.4.40.0120.00818.23
8.4.30.0030.01817.82
8.4.20.0200.00317.87
8.4.10.0060.00317.95
8.3.280.0110.00918.87
8.3.270.0100.01016.86
8.3.260.0040.00516.85
8.3.250.0080.01119.04
8.3.240.0120.00817.19
8.3.230.0110.00516.91
8.3.220.0120.00919.46
8.3.210.0120.00518.77
8.3.200.0070.00216.92
8.3.190.0120.00716.79
8.3.180.0060.00316.69
8.3.170.0090.00918.98
8.3.160.0090.00920.48
8.3.150.0070.01117.32
8.3.140.0030.00617.15
8.3.130.0060.00318.90
8.3.120.0080.00319.59
8.3.110.0050.00317.05
8.3.100.0090.00924.06
8.3.90.0050.00326.77
8.3.80.0060.00617.11
8.3.70.0130.00617.00
8.3.60.0120.00617.00
8.3.50.0120.00722.23
8.3.40.0070.00718.93
8.3.30.0120.00319.29
8.3.20.0040.00420.60
8.3.10.0080.00024.04
8.3.00.0080.00017.96
8.2.290.0140.00519.18
8.2.280.0030.00518.72
8.2.270.0160.00419.34
8.2.260.0060.00318.28
8.2.250.0100.00717.29
8.2.240.0040.00419.14
8.2.230.0030.00620.94
8.2.220.0050.00537.54
8.2.210.0090.00626.77
8.2.200.0040.00416.88
8.2.190.0120.00616.75
8.2.180.0190.00025.92
8.2.170.0090.00622.96
8.2.160.0070.00720.64
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00621.05
8.2.110.0060.00321.00
8.2.100.0000.01218.03
8.2.90.0000.00918.28
8.2.80.0050.00319.39
8.2.70.0030.00518.30
8.2.60.0030.00618.05
8.2.50.0080.00018.10
8.2.40.0040.00421.02
8.2.30.0040.00418.30
8.2.20.0030.00617.98
8.2.10.0000.00718.44
8.2.00.0050.00318.34
8.1.330.0100.00622.41
8.1.320.0110.01016.60
8.1.310.0060.01218.96
8.1.300.0040.00418.18
8.1.290.0040.00418.88
8.1.280.0110.00325.92
8.1.270.0040.00420.39
8.1.260.0080.00426.35
8.1.250.0050.00228.09
8.1.240.0060.00322.50
8.1.230.0110.00021.27
8.1.220.0040.00418.04
8.1.210.0050.00319.16
8.1.200.0050.00317.85
8.1.190.0000.00817.68
8.1.180.0000.00818.10
8.1.170.0050.00318.82
8.1.160.0030.00322.45
8.1.150.0000.00718.98
8.1.140.0000.00817.63
8.1.130.0070.00017.96
8.1.120.0030.00517.66
8.1.110.0050.00317.73
8.1.100.0000.00717.64
8.1.90.0040.00417.70
8.1.80.0040.00417.68
8.1.70.0000.00717.71
8.1.60.0030.00617.82
8.1.50.0040.00417.91
8.1.40.0030.00617.91
8.1.30.0040.00417.88
8.1.20.0000.00817.88
8.1.10.0030.00517.80
8.1.00.0000.00717.80
8.0.300.0070.00020.46
8.0.290.0000.00717.25
8.0.280.0070.00018.78
8.0.270.0000.00817.24
8.0.260.0000.00717.51
8.0.250.0000.00817.22
8.0.240.0000.00817.32
8.0.230.0000.00717.35
8.0.220.0000.00717.27
8.0.210.0000.00717.24
8.0.200.0060.00317.36
8.0.190.0060.00517.29
8.0.180.0030.00717.31
8.0.170.0070.00017.30
8.0.160.0000.00717.30
8.0.150.0000.00717.25
8.0.140.0040.00417.14
8.0.130.0030.00313.79
8.0.120.0000.00917.21
8.0.110.0050.00217.30
8.0.100.0000.00817.21
8.0.90.0050.00317.39
8.0.80.0100.00617.29
8.0.70.0000.00717.40
8.0.60.0000.00817.17
8.0.50.0040.00417.07
8.0.30.0030.01417.46
8.0.20.0050.01417.48
8.0.10.0040.00417.14
8.0.00.0110.00817.14
7.4.330.0020.00215.34
7.4.320.0000.00616.75
7.4.300.0030.00316.78
7.4.290.0000.00816.74
7.4.280.0040.00416.70
7.4.270.0000.00716.73
7.4.260.0040.00416.73
7.4.250.0000.00716.74
7.4.240.0050.00216.76
7.4.230.0030.00316.59
7.4.220.0120.00616.70
7.4.210.0080.00916.87
7.4.200.0040.00416.87
7.4.160.0120.00616.85
7.4.150.0120.00617.40
7.4.140.0040.01817.86
7.4.130.0120.00716.66
7.4.120.0150.00616.62
7.4.110.0090.00916.59
7.4.100.0060.02016.73
7.4.90.0070.01016.83
7.4.80.0140.00319.39
7.4.70.0070.01316.66
7.4.60.0070.01016.61
7.4.50.0040.00416.75
7.4.40.0090.00816.51
7.4.30.0130.00716.93
7.4.00.0040.01415.10
7.3.330.0020.00213.51
7.3.320.0140.00013.46
7.3.310.0070.00016.61
7.3.300.0030.00316.47
7.3.290.0060.00016.49
7.3.280.0070.01116.61
7.3.270.0130.00417.40
7.3.260.0060.01316.51
7.3.250.0080.00916.88
7.3.240.0130.00316.86
7.3.230.0060.01316.57
7.3.210.0070.01016.61
7.3.200.0070.01019.39
7.3.190.0070.01016.48
7.3.180.0000.01516.66
7.3.170.0100.00716.71
7.3.160.0120.00316.76
7.3.120.0070.01115.14
7.3.110.0060.01114.99
7.3.100.0000.01914.84
7.3.90.0030.00714.90
7.3.80.0040.00814.95
7.3.70.0100.00714.93
7.3.60.0090.00314.74
7.3.50.0070.00715.01
7.3.40.0070.00714.74
7.3.30.0060.01314.79
7.3.20.0060.00916.71
7.3.10.0070.00916.36
7.3.00.0060.00916.51
7.2.330.0080.01116.71
7.2.320.0060.01216.70
7.2.310.0120.00616.94
7.2.300.0110.00616.58
7.2.290.0070.01616.51
7.2.250.0120.00615.36
7.2.240.0160.00314.85
7.2.230.0000.01515.46
7.2.220.0040.01215.48
7.2.210.0070.00415.10
7.2.200.0060.00915.00
7.2.190.0000.01714.91
7.2.180.0090.00315.12
7.2.170.0080.00815.07
7.2.130.0090.00916.43
7.2.120.0150.00516.45
7.2.110.0190.00316.39
7.2.100.0160.00316.62
7.2.90.0110.01116.63
7.2.80.0220.00517.02
7.2.70.0150.00716.36
7.2.60.0050.01016.68
7.2.50.0050.01116.64
7.2.40.0190.00416.37
7.2.30.0150.00916.73
7.2.20.0190.00016.30
7.2.10.0160.00417.05
7.2.00.0160.00316.48
7.1.330.0130.00015.67
7.1.320.0030.00615.74
7.1.310.0070.00715.94
7.1.300.0090.00015.82
7.1.290.0030.01116.04
7.1.280.0000.01415.77
7.1.270.0030.01515.92
7.1.260.0110.00315.89
7.1.250.0090.00615.33
7.1.200.0040.00915.69
7.1.70.0000.00717.09
7.1.60.0050.01419.50
7.1.50.0150.00716.79
7.1.00.0030.07722.48
7.0.200.0030.00517.03
7.0.60.0100.08019.86
7.0.50.0130.07717.98
7.0.40.0130.06020.18
7.0.30.0570.04320.29
7.0.20.0270.04320.21
7.0.10.0030.04320.23
7.0.00.0070.08720.24
5.6.280.0000.07020.94
5.6.210.0000.09020.66
5.6.200.0070.03718.16
5.6.190.0100.08320.52
5.6.180.0200.03720.75
5.6.170.0500.06320.57
5.6.160.0130.08020.41
5.6.150.0070.04018.20
5.6.140.0100.07318.30
5.6.130.0030.05018.26
5.6.120.0030.04321.03
5.6.110.0030.04021.06
5.6.100.0070.06021.19
5.6.90.0030.04321.09
5.6.80.0100.08020.43
5.6.70.3830.04320.57
5.5.350.0230.06320.43
5.5.340.0030.08718.07
5.5.330.0100.05720.37
5.5.320.0130.05720.37
5.5.310.0330.06720.29
5.5.300.0000.04718.04
5.5.290.0070.08318.05
5.5.280.0070.08720.92
5.5.270.0070.05320.93
5.5.260.0030.08020.95
5.5.250.0100.08320.73
5.5.240.4000.03720.41
5.4.450.0130.04019.54
5.4.440.0030.04719.56
5.4.430.0130.03019.54
5.4.420.0100.05319.37
5.4.410.0170.04718.81
5.4.400.0070.05718.82
5.4.390.0100.05318.60
5.4.380.0130.05018.64
5.4.370.0200.04018.80
5.4.360.0230.06318.64
5.4.350.0170.05718.61
5.4.340.0130.04718.80
5.4.320.0070.05718.70
5.4.310.0100.05718.77
5.4.300.0230.06718.80
5.4.290.0130.07318.64
5.4.280.0130.06018.80
5.4.270.0170.04718.64
5.4.260.0100.07018.81
5.4.250.0170.07018.62
5.4.240.0200.04718.64
5.4.230.0070.05318.75
5.4.220.0070.06018.69
5.4.210.0130.05018.85
5.4.200.0170.05716.71
5.4.190.0100.05018.70
5.4.180.0170.05718.53
5.4.170.0100.06318.63
5.4.160.0000.06018.56
5.4.150.0100.05318.68
5.4.140.0070.05716.30
5.4.130.0170.04316.32
5.4.120.0200.04016.32
5.4.110.0100.05016.23
5.4.100.0070.05716.48
5.4.90.0030.05716.21
5.4.80.0100.05016.34
5.4.70.0130.04716.34
5.4.60.0030.05716.38
5.4.50.0070.05316.13
5.4.40.0100.05316.23
5.4.30.0070.06716.15
5.4.20.0130.04716.45
5.4.10.0170.04316.41
5.4.00.0030.07315.74
5.3.290.0130.05014.79
5.3.280.0170.04714.75
5.3.270.0030.06314.73
5.3.260.0070.06014.80
5.3.250.0130.04714.62
5.3.240.0030.06014.75
5.3.230.0130.04714.73
5.3.220.0170.04314.75
5.3.210.0130.05314.58
5.3.200.0170.05014.63
5.3.190.0170.04714.68
5.3.180.0030.05714.68
5.3.170.0130.05014.81
5.3.160.0100.07014.67
5.3.150.0130.06014.69
5.3.140.0170.04714.84
5.3.130.0170.06014.85
5.3.120.0170.05714.65
5.3.110.0170.05714.66
5.3.100.0130.04714.15
5.3.90.0170.06714.15
5.3.80.0100.05314.13
5.3.70.0100.05014.23
5.3.60.0100.04714.13
5.3.50.0130.06314.20
5.3.40.0030.05713.96
5.3.30.0070.05013.93
5.3.20.0070.05013.84
5.3.10.0100.05013.73
5.3.00.0130.05013.74
5.2.170.0030.04711.27
5.2.160.0100.03711.26
5.2.150.0000.05011.27
5.2.140.0070.04311.25
5.2.130.0070.04311.25
5.2.120.0030.04311.22
5.2.110.0130.04011.22
5.2.100.0100.03311.23
5.2.90.0030.04311.21
5.2.80.0100.03711.23
5.2.70.0070.04011.34
5.2.60.0100.03711.11
5.2.50.0070.04011.23
5.2.40.0100.04011.03
5.2.30.0070.04011.08
5.2.20.0100.03711.16
5.2.10.0100.03711.03
5.2.00.0070.04310.81
5.1.60.0000.04010.08
5.1.50.0030.03710.28
5.1.40.0030.05010.04
5.1.30.0070.05010.50
5.1.20.0070.03310.50
5.1.10.0130.03010.17
5.1.00.0100.04310.19
5.0.50.0000.0338.88
5.0.40.0070.0278.69
5.0.30.0070.0408.29
5.0.20.0030.0308.28
5.0.10.0030.0308.27
5.0.00.0000.0508.28
4.4.90.0100.0175.91
4.4.80.0030.0275.90
4.4.70.0100.0235.89
4.4.60.0070.0175.93
4.4.50.0000.0235.88
4.4.40.0000.0375.92
4.4.30.0070.0205.88
4.4.20.0070.0205.89
4.4.10.0030.0235.95
4.4.00.0000.0375.89
4.3.110.0070.0175.87
4.3.100.0100.0175.86
4.3.90.0000.0235.80
4.3.80.0000.0375.83
4.3.70.0000.0235.80
4.3.60.0030.0235.80
4.3.50.0030.0305.80
4.3.40.0000.0375.79
4.3.30.0000.0234.64
4.3.20.0000.0234.58
4.3.10.0030.0204.52
4.3.00.0000.01716.51

preferences:
206.25 ms | 403 KiB | 5 Q