3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_tumbail($imgSrc,$placeholder_image){ $imgPattern = "/(http\:\/\/ww\d+\.sinaimg\.cn\/)(\w+)(\/\S+\.(jpg|gif))/i"; $matches = null; $result = preg_match($imgPattern, $imgSrc, $matches); if (!$result) { return $placeholder_image; } return $matches[1] . 'thumbnail' . $matches[3]; } $placeholder_image = 'images/transparent.gif'; $imgStr = '<img src="http://ww2.sinaimg.cn/bmiddle/a3d444e3jw1ez79amvdi1j20l50s8gpl.jpg"/>'; $imgStr = preg_replace_callback('#<img([^>]+?)src=[\'"]?([^\'"\s>]+)[\'"]?([^>]*)>#',function($match) { var_dump($match); return sprintf('<img${1}src="%s" data-original="${2}" class="lazy"${3}><noscript><img${1}src="${2}"${3}></noscript>', get_tumbail($match[2],$placeholder_image)); },$imgStr); var_dump($imgStr);

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.00316.98
8.3.50.0100.01021.38
8.3.40.0070.01119.21
8.3.30.0040.01119.09
8.3.20.0040.00420.33
8.3.10.0040.00421.87
8.3.00.0030.00523.53
8.2.180.0120.00618.79
8.2.170.0000.01422.96
8.2.160.0090.00620.38
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0030.00619.66
8.2.120.0080.00026.35
8.2.110.0070.00322.39
8.2.100.0070.00418.05
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0030.00617.88
8.2.60.0060.00618.00
8.2.50.0040.00418.07
8.2.40.0040.00422.45
8.2.30.0000.00719.61
8.2.20.0040.00417.93
8.2.10.0040.00418.13
8.2.00.0050.00218.13
8.1.280.0120.00325.92
8.1.270.0080.00020.38
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0060.00323.79
8.1.230.0060.00619.13
8.1.220.0080.00017.90
8.1.210.0000.00918.77
8.1.200.0000.00917.72
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0000.00818.84
8.1.160.0000.00720.90
8.1.150.0000.00718.97
8.1.140.0040.00419.76
8.1.130.0000.00717.86
8.1.120.0050.00317.66
8.1.110.0030.00517.57
8.1.100.0050.00317.54
8.1.90.0030.00517.55
8.1.80.0030.00317.68
8.1.70.0030.00517.53
8.1.60.0050.00317.68
8.1.50.0080.00017.59
8.1.40.0000.00817.69
8.1.30.0040.00417.87
8.1.20.0080.00017.82
8.1.10.0030.00617.78
8.1.00.0050.00517.68
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0040.00418.58
8.0.270.0000.00717.36
8.0.260.0000.00717.19
8.0.250.0030.00317.17
8.0.240.0040.00417.08
8.0.230.0000.00817.10
8.0.220.0000.00717.23
8.0.210.0040.00417.04
8.0.200.0000.01017.22
8.0.190.0040.00417.19
8.0.180.0050.00317.05
8.0.170.0060.00317.20
8.0.160.0040.00417.13
8.0.150.0020.00517.08
8.0.140.0060.00317.00
8.0.130.0030.00313.55
8.0.120.0040.00417.18
8.0.110.0070.00017.31
8.0.100.0000.00717.02
8.0.90.0050.00217.23
8.0.80.0100.01317.20
8.0.70.0050.00217.18
8.0.60.0040.00417.19
8.0.50.0040.00417.24
8.0.30.0130.00517.26
8.0.20.0110.00917.40
8.0.10.0000.00717.32
8.0.00.0100.00817.04
7.4.330.0000.00616.81
7.4.320.0000.00616.84
7.4.300.0000.00816.91
7.4.290.0000.00816.94
7.4.280.0040.00416.82
7.4.270.0000.00716.90
7.4.260.0060.00316.92
7.4.250.0000.00816.84
7.4.240.0020.00616.85
7.4.230.0000.00716.74
7.4.220.0150.00316.95
7.4.210.0100.00616.86
7.4.200.0070.00016.86
7.4.160.0160.00416.77
7.4.150.0120.00617.40
7.4.140.0070.01417.86
7.4.130.0150.01016.82
7.4.120.0130.00616.80
7.4.110.0000.02316.85
7.4.100.0100.01016.85
7.4.90.0070.01616.80
7.4.80.0130.00619.39
7.4.70.0040.01516.91
7.4.60.0000.01616.81
7.4.50.0070.01416.66
7.4.40.0120.00616.68
7.4.30.0070.01116.59
7.4.00.0000.01415.30
7.3.330.0050.00013.49
7.3.320.0030.00313.40
7.3.310.0080.00016.58
7.3.300.0000.00716.52
7.3.290.0030.00316.56
7.3.280.0060.01316.52
7.3.270.0090.00917.40
7.3.260.0100.01016.55
7.3.250.0120.00816.69
7.3.240.0140.00316.78
7.3.230.0140.00916.58
7.3.210.0120.00616.64
7.3.200.0090.00819.39
7.3.190.0060.01116.58
7.3.180.0120.01216.72
7.3.170.0160.00016.73
7.3.160.0070.01016.60
7.3.10.0040.01116.60
7.3.00.0090.00616.77
7.2.330.0090.00916.80
7.2.320.0060.01216.93
7.2.310.0090.00916.75
7.2.300.0100.00716.85
7.2.290.0060.01616.98
7.2.130.0070.00716.86
7.2.120.0030.01616.76
7.2.110.0140.00916.99
7.2.100.0080.00816.87
7.2.90.0040.01717.16
7.2.80.0090.00616.72
7.2.70.0000.01816.45
7.2.60.0190.00316.94
7.2.50.0120.00816.94
7.2.40.0080.01017.00
7.2.30.0140.01117.15
7.2.20.0150.01617.04
7.2.10.0170.00916.93
7.2.00.0160.00518.35
7.1.250.0100.01015.76
7.1.100.0040.00818.56
7.1.70.0060.00317.41
7.1.60.0070.01719.20
7.1.50.0140.01034.86
7.1.00.0070.07322.38
7.0.200.0000.00716.90
7.0.60.0200.07721.87
7.0.50.0070.08317.91
7.0.40.0030.05019.99
7.0.30.0230.06020.08
7.0.20.0400.04720.11
7.0.10.0000.04720.09
7.0.00.0200.06320.32
5.6.280.0000.03721.11
5.6.210.0100.07720.67
5.6.200.0200.06718.16
5.6.190.0130.03720.47
5.6.180.0430.07320.64
5.6.170.0200.04020.48
5.6.160.0100.05320.45
5.6.150.0030.05718.29
5.6.140.0100.05718.18
5.6.130.0130.06718.15
5.6.120.0030.04720.96
5.6.110.0030.07721.00
5.6.100.0100.08320.89
5.6.90.0070.08320.99
5.6.80.0170.04320.43
5.5.350.0030.04720.43
5.5.340.0130.07017.98
5.5.330.0100.08320.56
5.5.320.0130.04720.27
5.5.310.0130.04320.28
5.5.300.0070.03717.96
5.5.290.0100.07718.09
5.5.280.0030.04320.86
5.5.270.0070.08320.75
5.5.260.0070.08720.66
5.5.250.0100.06720.69
5.5.240.0200.07320.29

preferences:
45.03 ms | 401 KiB | 5 Q