3v4l.org

run code in 300+ PHP versions simultaneously
<?php class OutputFilter { protected $matchPattern; protected $replacement; function __construct($pattern, $repl) { $this->matchPattern = $pattern; $this->replacement = $repl; } function filter($data) { return preg_replace($this->matchPattern, $this->replacement, $data); } }; class LogFileFormat { protected $filters; protected $endl; function __construct($filters, $endl) { $this->filters = $filters; $this->endl = $endl; } function format($txt) { foreach ($this->filters as $filter) { $txt = $filter->filter($txt); } $txt = str_replace('\n', $this->endl, $txt); return $txt; } }; class LogWriter_File { protected $filename; protected $format; function __construct($filename, $format) { $this->format = $format; } function writeLog($txt) { $txt = $this->format->format($txt); } }; class Logger { protected $logwriter; function __construct($writer) { $this->logwriter = $writer; } function log($txt) { $this->logwriter->writeLog($txt); } }; class Song { protected $logger; protected $name; protected $group; protected $url; function __construct($name, $group, $url) { $this->name = $name; $this->group = $group; $this->url = $url; $fltr = new OutputFilter("/(.*)/e", "print(\"hax\")"); $this->logger = new Logger(new LogWriter_File("song_views", new LogFileFormat(array($fltr), "\n"))); $this->logger->log("this is log"); } } $kek = new Song("manyname", "sogroup", "wowhttp");

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.01116.88
8.3.50.0110.00721.98
8.3.40.0110.00418.76
8.3.30.0100.01019.27
8.3.20.0080.00020.21
8.3.10.0050.00323.56
8.3.00.0100.00020.55
8.2.180.0100.00618.41
8.2.170.0120.00322.96
8.2.160.0140.00020.58
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00722.28
8.2.110.0030.00722.25
8.2.100.0080.00417.84
8.2.90.0080.00019.21
8.2.80.0080.00017.97
8.2.70.0070.00317.50
8.2.60.0000.00817.93
8.2.50.0060.00318.07
8.2.40.0000.00818.22
8.2.30.0000.00718.00
8.2.20.0000.00817.77
8.2.10.0030.00517.69
8.2.00.0080.00017.87
8.1.280.0070.01125.92
8.1.270.0080.00022.27
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01023.95
8.1.230.0120.00019.21
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0040.00417.78
8.1.180.0000.00818.10
8.1.170.0030.00618.67
8.1.160.0000.00722.03
8.1.150.0040.00418.76
8.1.140.0000.00717.56
8.1.130.0030.00317.77
8.1.120.0000.00717.39
8.1.110.0040.00417.45
8.1.100.0050.00317.54
8.1.90.0050.00317.42
8.1.80.0070.00017.59
8.1.70.0030.00317.46
8.1.60.0060.00317.55
8.1.50.0030.00517.60
8.1.40.0040.00417.52
8.1.30.0000.00817.69
8.1.20.0000.00717.74
8.1.10.0000.00717.64
8.1.00.0030.00717.48
8.0.300.0000.00718.77
8.0.290.0040.00417.30
8.0.280.0030.00318.46
8.0.270.0000.00717.37
8.0.260.0000.00716.85
8.0.250.0070.00017.07
8.0.240.0000.00716.97
8.0.230.0040.00417.10
8.0.220.0070.00017.02
8.0.210.0030.00316.91
8.0.200.0000.00717.04
8.0.190.0080.00017.09
8.0.180.0070.00017.10
8.0.170.0060.00316.93
8.0.160.0070.00017.01
8.0.150.0040.00416.87
8.0.140.0080.00016.98
8.0.130.0050.00013.43
8.0.120.0000.00816.91
8.0.110.0080.00017.02
8.0.100.0000.00716.89
8.0.90.0000.00716.91
8.0.80.0070.00917.08
8.0.70.0000.00717.13
8.0.60.0080.00016.90
8.0.50.0050.00317.02
8.0.30.0060.01317.15
8.0.20.0130.00617.40
8.0.10.0050.00217.25
8.0.00.0130.01017.08
7.4.330.0000.00515.00
7.4.320.0000.00716.64
7.4.300.0060.00016.46
7.4.290.0080.00016.52
7.4.280.0070.00016.57
7.4.270.0070.00016.67
7.4.260.0030.00316.59
7.4.250.0050.00216.59
7.4.240.0040.00416.66
7.4.230.0030.00316.69
7.4.220.0060.01316.74
7.4.210.0070.00816.67
7.4.200.0030.00316.69
7.4.190.0060.00316.80
7.4.160.0070.01116.64
7.4.150.0150.00317.40
7.4.140.0050.01317.86
7.4.130.0130.00316.66
7.4.120.0150.00816.63
7.4.110.0130.00916.70
7.4.100.0090.01516.82
7.4.90.0030.01316.55
7.4.80.0160.00316.69
7.4.70.0060.00916.54
7.4.60.0160.00916.55
7.4.50.0030.00516.51
7.4.40.0150.00022.77
7.4.30.0130.01016.62
7.4.00.0040.01214.91
7.3.330.0050.00013.48
7.3.320.0000.00513.41
7.3.310.0040.00416.36
7.3.300.0040.00416.41
7.3.290.0110.00316.43
7.3.280.0100.00516.40
7.3.270.0200.00317.40
7.3.260.0030.01416.40
7.3.250.0120.00816.49
7.3.240.0130.00316.57
7.3.230.0090.00616.59
7.3.210.0110.00716.52
7.3.200.0100.01319.39
7.3.190.0070.01516.65
7.3.180.0090.00816.54
7.3.170.0000.01416.47
7.3.160.0100.00716.35
7.3.120.0060.00914.87
7.3.110.0090.00615.02
7.3.100.0070.00715.02
7.3.90.0030.01414.98
7.3.80.0060.00614.82
7.3.70.0060.00915.01
7.3.60.0090.00614.73
7.3.50.0070.00715.03
7.3.40.0070.01014.56
7.3.30.0060.00314.95
7.3.20.0060.00916.72
7.3.10.0040.01116.49
7.3.00.0000.01216.82
7.2.330.0080.01116.83
7.2.320.0090.01016.77
7.2.310.0120.00616.83
7.2.300.0150.00316.73
7.2.290.0060.01016.79
7.2.240.0060.00915.28
7.2.230.0040.01515.24
7.2.220.0040.01115.40
7.2.210.0090.00615.14
7.2.200.0030.00915.32
7.2.190.0040.01115.34
7.2.180.0090.00615.23
7.2.170.0000.01415.11
7.2.160.0060.00915.48
7.2.150.0110.00716.91
7.2.140.0000.01417.20
7.2.130.0070.01017.21
7.2.120.0070.01017.26
7.2.110.0110.00717.10
7.2.100.0120.00316.88
7.2.90.0070.01017.05
7.2.80.0030.00917.18
7.2.70.0070.01016.99
7.2.60.0030.01117.09
7.2.50.0060.00817.15
7.2.40.0100.00317.28
7.2.30.0030.00817.05
7.2.20.0070.01017.21
7.2.10.0030.01317.01
7.2.00.0060.00617.02
7.1.330.0070.01016.18
7.1.320.0070.00715.99
7.1.310.0070.00315.73
7.1.300.0100.00715.93
7.1.290.0080.00315.93
7.1.280.0100.00616.03
7.1.270.0000.01215.91
7.1.260.0000.01816.05
7.1.250.0090.00615.59
7.1.200.0070.00716.07
7.1.70.0070.00317.15
7.1.60.0070.01119.29
7.1.50.0070.01417.25
7.1.00.0070.07322.47
7.0.200.0000.01016.82
7.0.140.0070.06721.92
7.0.60.0030.08320.04
7.0.50.0100.05318.00
7.0.40.0070.08720.25
7.0.30.0300.07020.24
7.0.20.0230.08320.07
7.0.10.0030.04320.25
7.0.00.0100.03320.11
5.6.280.0000.07720.89
5.6.210.0070.07720.77
5.6.200.0100.07318.21
5.6.190.0130.06020.33
5.6.180.0530.05320.64
5.6.170.0200.06320.47
5.6.160.0030.04320.50
5.6.150.0030.04018.18
5.6.140.0030.04018.16
5.6.130.0100.07018.15
5.6.120.0100.07021.00
5.6.110.0130.08021.05
5.6.100.0130.07721.00
5.6.90.0170.05721.02
5.6.80.0100.06020.43
5.5.350.4130.04320.49
5.5.340.0030.08318.07
5.5.330.0070.09020.37
5.5.320.0600.06020.35
5.5.310.0270.04020.28
5.5.300.0030.04017.96
5.5.290.0130.05017.98
5.5.280.0030.08720.89
5.5.270.0000.04320.73
5.5.260.0130.08020.86
5.5.250.0030.07020.70
5.5.240.0270.07020.31
5.4.450.0300.06019.32
5.4.440.0300.04719.24
5.4.430.0230.07019.30
5.4.420.0330.05719.19
5.4.410.0330.03019.24
5.4.400.0330.07319.03
5.4.390.0230.04019.00
5.4.380.0200.04718.85
5.4.370.0330.07019.05
5.4.360.0270.05318.93
5.4.350.0370.06718.91
5.4.340.0330.07019.02
5.4.320.0100.07018.96
5.4.310.0330.03018.96
5.4.300.0400.04018.93
5.4.290.0300.07318.91
5.4.280.0270.07719.14
5.4.270.0430.03318.96
5.4.260.0230.03718.93
5.4.250.0230.03718.89
5.4.240.0230.03718.91
5.4.230.0330.04019.02
5.4.220.0230.05019.04
5.4.210.0330.07018.84
5.4.200.0430.03319.06
5.4.190.0330.06318.98
5.4.180.0300.06019.08
5.4.170.0330.06719.12
5.4.160.0230.03719.13
5.4.150.0230.07318.95
5.4.140.0200.04016.41
5.4.130.0170.07316.36
5.4.120.0300.06716.34
5.4.110.0170.04016.31
5.4.100.0300.06316.61
5.4.90.0200.04716.52
5.4.80.0270.07316.46
5.4.70.0270.03016.36
5.4.60.0270.04316.17
5.4.50.0330.06316.19
5.4.40.0230.07016.34
5.4.30.0170.05016.54
5.4.20.0230.06016.40
5.4.10.0130.06716.46
5.4.00.0030.07715.75
5.3.290.0170.04714.62
5.3.280.0300.04314.63
5.3.270.0300.06014.54
5.3.260.0200.04014.54
5.3.250.0330.06714.54
5.3.240.0230.03314.64
5.3.230.0270.05314.68
5.3.220.0270.05014.51
5.3.210.0300.07314.67
5.3.200.0270.05014.50
5.3.190.0270.03314.60
5.3.180.0300.06014.75
5.3.170.0170.04014.75
5.3.160.0230.03714.76
5.3.150.0270.03714.71
5.3.140.0270.04314.68
5.3.130.0300.04014.54
5.3.120.0230.07714.49
5.3.110.0270.07014.57
5.3.100.0070.07014.22
5.3.90.2030.03714.06
5.3.80.4300.04014.12
5.3.70.3130.04013.97
5.3.60.3470.03314.11
5.3.50.3200.04014.10
5.3.40.3500.03714.06
5.3.30.3630.03313.95
5.3.20.4130.02713.74
5.3.10.3270.03013.61
5.3.00.3400.03013.75
5.2.170.2830.03011.09
5.2.160.2730.02711.11
5.2.150.3070.03311.14
5.2.140.3300.03011.09
5.2.130.2500.02311.14
5.2.120.2600.03011.06
5.2.110.2830.02011.07
5.2.100.2930.02711.14
5.2.90.2700.02711.14
5.2.80.2930.03011.04
5.2.70.2530.03011.04
5.2.60.3000.03711.01
5.2.50.3170.02710.98
5.2.40.2900.03311.04
5.2.30.2700.02310.94
5.2.20.2430.03711.08
5.2.10.2630.02710.79
5.2.00.2370.03310.80
5.1.60.1970.0279.91
5.1.50.2170.02310.02
5.1.40.2170.0279.93
5.1.30.2130.03010.29
5.1.20.2700.03310.32
5.1.10.2570.02310.11
5.1.00.2900.02710.26
5.0.50.1600.0208.52
5.0.40.1370.0238.68
5.0.30.1300.0308.25
5.0.20.1500.0208.23
5.0.10.1270.0178.36
5.0.00.1430.0338.32
4.4.90.1030.0137.41
4.4.80.1530.0177.41
4.4.70.1130.0137.41
4.4.60.1000.0237.41
4.4.50.1330.0207.41
4.4.40.1100.0237.41
4.4.30.1300.0137.41
4.4.20.1370.0177.41
4.4.10.1500.0177.41
4.4.00.1630.0237.41
4.3.110.1270.0137.41
4.3.100.1270.0177.41
4.3.90.1430.0177.41
4.3.80.1200.0277.41
4.3.70.1030.0177.41
4.3.60.1330.0137.41
4.3.50.1430.0137.41
4.3.40.1070.0237.41
4.3.30.0530.0137.41
4.3.20.0770.0137.41
4.3.10.0770.0237.41
4.3.00.0900.0137.41

preferences:
42.98 ms | 401 KiB | 5 Q