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", "echo \"so 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.40.0090.00618.66
8.3.30.0070.00719.23
8.3.20.0030.00520.33
8.3.10.0000.00822.13
8.3.00.0050.00322.43
8.2.170.0110.00422.96
8.2.160.0130.00319.02
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0000.00926.16
8.2.120.0050.00317.75
8.2.110.0060.00322.23
8.2.100.0040.00819.57
8.2.90.0000.00819.17
8.2.80.0030.00517.97
8.2.70.0000.00817.62
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0000.00918.23
8.2.30.0030.00818.05
8.2.20.0040.00417.85
8.2.10.0040.00419.49
8.2.00.0060.00317.68
8.1.270.0000.00821.94
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.85
8.1.230.0110.00019.12
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.36
8.1.190.0000.00817.66
8.1.180.0040.00418.10
8.1.170.0080.00018.63
8.1.160.0040.00422.08
8.1.150.0040.00418.58
8.1.140.0090.00017.58
8.1.130.0040.00417.89
8.1.120.0040.00417.51
8.1.110.0040.00417.57
8.1.100.0000.00717.58
8.1.90.0040.00417.38
8.1.80.0000.00717.54
8.1.70.0040.00417.46
8.1.60.0030.00517.60
8.1.50.0040.00417.61
8.1.40.0000.00917.54
8.1.30.0040.00417.68
8.1.20.0040.00417.70
8.1.10.0050.00217.63
8.1.00.0040.00417.46
8.0.300.0070.00018.77
8.0.290.0000.00717.16
8.0.280.0030.00518.48
8.0.270.0000.00817.32
8.0.260.0030.00316.95
8.0.250.0040.00417.12
8.0.240.0000.00817.11
8.0.230.0090.00017.09
8.0.220.0070.00016.96
8.0.210.0090.00017.01
8.0.200.0000.00617.06
8.0.190.0030.00317.06
8.0.180.0030.00317.00
8.0.170.0060.00316.92
8.0.160.0030.00616.99
8.0.150.0000.00717.09
8.0.140.0030.00516.89
8.0.130.0050.00013.45
8.0.120.0080.00017.03
8.0.110.0070.00016.84
8.0.100.0050.00216.88
8.0.90.0040.00416.92
8.0.80.0040.01317.09
8.0.70.0040.00417.07
8.0.60.0000.00717.09
8.0.50.0020.00516.91
8.0.30.0110.00817.24
8.0.20.0140.00617.40
8.0.10.0070.00017.11
8.0.00.0120.00916.98
7.4.330.0040.00415.00
7.4.320.0030.00316.66
7.4.300.0030.00516.66
7.4.290.0030.00316.47
7.4.280.0000.00716.56
7.4.270.0030.00616.63
7.4.260.0070.00016.57
7.4.250.0040.00416.54
7.4.240.0060.00116.51
7.4.230.0050.00316.70
7.4.220.0090.01316.61
7.4.210.0050.01116.65
7.4.200.0000.00716.54
7.4.190.0000.00716.63
7.4.160.0000.01716.84
7.4.150.0160.00317.40
7.4.140.0110.01017.86
7.4.130.0100.00816.68
7.4.120.0080.01016.62
7.4.110.0140.00316.65
7.4.100.0130.00316.57
7.4.90.0090.00916.56
7.4.80.0060.01619.39
7.4.70.0100.00616.74
7.4.60.0110.00916.73
7.4.50.0000.00916.53
7.4.40.0070.01022.77
7.4.30.0110.01116.61
7.4.00.0110.00715.11
7.3.330.0030.00313.24
7.3.320.0030.00313.36
7.3.310.0070.00016.26
7.3.300.0030.00316.45
7.3.290.0050.01116.38
7.3.280.0090.00816.38
7.3.270.0100.01017.40
7.3.260.0190.00316.44
7.3.250.0140.00416.59
7.3.240.0060.01116.63
7.3.230.0120.00616.60
7.3.210.0080.00816.47
7.3.200.0100.01019.39
7.3.190.0130.01016.44
7.3.180.0130.00316.60
7.3.170.0130.01016.54
7.3.160.0080.00916.52
7.3.120.0080.00814.87
7.2.330.0090.00917.00
7.2.320.0090.00916.88
7.2.310.0070.01016.89
7.2.300.0120.00916.91
7.2.290.0140.00317.11
7.2.60.0090.00616.93
7.1.200.0050.00515.89
7.1.70.0000.00717.12
7.1.60.0190.00019.82
7.1.50.0040.02117.07
7.1.00.0000.07722.29
7.0.200.0100.00317.02
7.0.140.0030.07021.94
7.0.60.0170.07319.99
7.0.50.0000.04317.99
7.0.40.0070.04720.12
7.0.30.0270.04720.25
7.0.20.0300.08020.18
7.0.10.0300.07320.35
7.0.00.0070.03720.21
5.6.280.0070.07020.88
5.6.210.0230.05320.52
5.6.200.0100.08318.17
5.6.190.0070.04320.61
5.6.180.3330.04020.57
5.6.170.0270.07720.58
5.6.160.0000.04720.39
5.6.150.0030.06018.21
5.6.140.0100.07718.15
5.6.130.0230.07018.27
5.6.120.0070.04021.05
5.6.110.0070.08021.01
5.6.100.0130.03721.04
5.6.90.0070.06321.02
5.6.80.0000.04720.41
5.6.70.0200.06720.49
5.5.350.0100.08020.45
5.5.340.0170.07018.07
5.5.330.0070.04720.40
5.5.320.0200.04720.36
5.5.310.0270.07320.24
5.5.300.0070.04718.05
5.5.290.0030.05717.97
5.5.280.0070.05320.67
5.5.270.0070.08320.70
5.5.260.0070.08721.00
5.5.250.0130.07020.69
5.5.240.0100.05320.17
5.4.450.0500.06719.31
5.4.440.0430.07019.30
5.4.430.0170.04719.56
5.4.420.0070.06019.51
5.4.410.0100.05319.52
5.4.400.0130.04718.68
5.4.390.0170.04718.79
5.4.380.0300.04718.77
5.4.370.0130.05718.78
5.4.360.0100.06018.52
5.4.350.0300.04318.59
5.4.340.0070.06318.79
5.4.320.0110.04012.54
5.4.310.0040.04012.53
5.4.300.0040.03912.54
5.4.290.0070.03712.52
5.4.280.0060.03612.43
5.4.270.0130.06319.01
5.4.260.0170.04718.95
5.4.250.0070.07719.11
5.4.240.0130.06018.94
5.4.230.0030.08319.02
5.4.220.0070.07018.94
5.4.210.0200.06718.83
5.4.200.0170.07318.86
5.4.190.0170.05018.83
5.4.180.0000.07719.19
5.4.170.0070.06019.09
5.4.160.0100.07718.90
5.4.150.0070.08318.92
5.4.140.0200.05716.68
5.4.130.0130.05316.75
5.4.120.0070.06016.59
5.4.110.0230.04016.68
5.4.100.0130.06016.73
5.4.90.0130.04716.59
5.4.80.0200.04316.59
5.4.70.0100.06716.75
5.4.60.0030.06316.58
5.4.50.0130.06016.42
5.4.40.0070.07016.61
5.4.30.0100.06716.66
5.4.20.0130.07016.42
5.4.10.0030.06016.68
5.4.00.0200.06016.12
5.3.290.0060.03912.80
5.3.280.0170.06314.85
5.3.270.0130.05314.71
5.3.260.0200.06014.82
5.3.250.0070.07014.94
5.3.240.0030.08014.77
5.3.230.0230.05714.75
5.3.220.0030.06714.48
5.3.210.0170.07314.79
5.3.200.0200.06314.87
5.3.190.0130.06714.79
5.3.180.0170.05014.86
5.3.170.0100.05314.86
5.3.160.0170.04314.48
5.3.150.0200.05714.79
5.3.140.0100.07314.87
5.3.130.0170.06314.58
5.3.120.0100.06714.84
5.3.110.0130.08014.77
5.3.100.0170.07014.29
5.3.90.0130.06014.11
5.3.80.0100.07014.34
5.3.70.0400.05314.10
5.3.60.0030.05714.02
5.3.50.0170.05314.27
5.3.40.0100.05714.27
5.3.30.0070.07313.99
5.3.20.0100.06313.93
5.3.10.0100.05313.96
5.3.00.0170.06013.79
5.2.170.0100.06011.18
5.2.160.0130.05011.36
5.2.150.0200.04311.30
5.2.140.0170.04711.38
5.2.130.0070.04311.19
5.2.120.0200.04011.21
5.2.110.0100.04311.44
5.2.100.0100.05711.14
5.2.90.0200.03311.43
5.2.80.0170.04711.25
5.2.70.0100.04311.24
5.2.60.0200.04711.39
5.2.50.0170.05311.25
5.2.40.0000.06011.04
5.2.30.0200.03711.20
5.2.20.0100.04711.12
5.2.10.0030.04711.16
5.2.00.0200.04010.98
5.1.60.0130.04010.36
5.1.50.0070.04010.24
5.1.40.0170.03310.32
5.1.30.0130.03310.43
5.1.20.0130.04310.51
5.1.10.0100.04710.34
5.1.00.0100.03710.41
5.0.50.0100.0278.80
5.0.40.0030.0338.75
5.0.30.0030.0538.58
5.0.20.0100.0338.54
5.0.10.0100.0278.27
5.0.00.0070.0538.49
4.4.90.0100.0277.25
4.4.80.0100.0237.25
4.4.70.0030.0237.25
4.4.60.0030.0277.25
4.4.50.0070.0277.25
4.4.40.0130.0377.25
4.4.30.0030.0277.25
4.4.20.0130.0237.49
4.4.10.0070.0207.48
4.4.00.0130.0377.48
4.3.110.0030.0237.48
4.3.100.0100.0177.48
4.3.90.0070.0207.48
4.3.80.0000.0377.48
4.3.70.0030.0237.48
4.3.60.0030.0307.48
4.3.50.0030.0237.48
4.3.40.0030.0477.48
4.3.30.0100.0237.48
4.3.20.0030.0307.48
4.3.10.0000.0237.48
4.3.00.0070.0237.38

preferences:
38.73 ms | 400 KiB | 5 Q