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"); } } class Lyrics { protected $lyrics; protected $song; function __construct($lyrics, $song) { $this->song = $song; $this->lyrics = $lyrics; } }; $kek = new Song("manyname", "sogroup", "wowhttp"); $lyr = new Lyrics("same old kid", $kek); $uus = array($lyr); echo serialize($lyr);

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.70.0150.00416.75
8.3.60.0040.01118.56
8.3.50.0110.00822.01
8.3.40.0120.00318.99
8.3.30.0070.00719.21
8.3.20.0080.00020.30
8.3.10.0060.00322.01
8.3.00.0070.00022.39
8.2.190.0000.01416.75
8.2.180.0140.00416.75
8.2.170.0090.00622.96
8.2.160.0070.00719.04
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0090.00022.29
8.2.100.0120.00019.70
8.2.90.0000.00819.22
8.2.80.0040.00418.03
8.2.70.0050.00317.50
8.2.60.0000.00918.04
8.2.50.0000.00818.07
8.2.40.0000.00818.22
8.2.30.0040.00718.04
8.2.20.0030.00517.69
8.2.10.0000.00819.42
8.2.00.0000.00817.78
8.1.280.0040.01125.92
8.1.270.0070.00721.98
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00023.96
8.1.230.0000.01019.10
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.53
8.1.180.0080.00018.10
8.1.170.0050.00318.56
8.1.160.0080.00021.97
8.1.150.0000.00718.72
8.1.140.0080.00417.39
8.1.130.0030.00617.75
8.1.120.0000.00817.51
8.1.110.0080.00017.52
8.1.100.0030.00317.49
8.1.90.0040.00417.38
8.1.80.0000.00717.54
8.1.70.0070.00017.45
8.1.60.0000.00817.59
8.1.50.0070.00017.45
8.1.40.0030.00617.51
8.1.30.0040.00417.65
8.1.20.0040.00417.77
8.1.10.0030.00617.51
8.1.00.0000.00717.51
8.0.300.0040.00418.77
8.0.290.0080.00017.29
8.0.280.0000.00718.49
8.0.270.0040.00417.21
8.0.260.0030.00316.80
8.0.250.0050.00317.04
8.0.240.0000.00817.04
8.0.230.0000.00817.00
8.0.220.0000.00716.91
8.0.210.0030.00516.88
8.0.200.0000.00617.07
8.0.190.0040.00416.99
8.0.180.0040.00416.95
8.0.170.0050.00317.04
8.0.160.0000.00717.03
8.0.150.0000.00716.84
8.0.140.0080.00017.02
8.0.130.0030.00313.38
8.0.120.0050.00316.96
8.0.110.0040.00416.93
8.0.100.0040.00416.79
8.0.90.0000.00716.85
8.0.80.0090.00717.05
8.0.70.0040.00416.99
8.0.60.0030.00516.98
8.0.50.0050.00216.94
8.0.30.0150.00817.12
8.0.20.0060.01217.41
8.0.10.0070.00016.98
8.0.00.0130.01216.88
7.4.330.0000.00515.00
7.4.320.0070.00016.65
7.4.300.0000.00616.68
7.4.290.0000.00816.57
7.4.280.0080.00016.63
7.4.270.0040.00716.69
7.4.260.0070.00016.51
7.4.250.0040.00416.65
7.4.240.0070.00116.48
7.4.230.0080.00016.62
7.4.220.0060.01316.58
7.4.210.0040.01116.55
7.4.200.0030.00316.36
7.4.190.0000.00716.52
7.4.160.0090.00916.66
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0090.01116.66
7.4.120.0100.01016.65
7.4.110.0090.00916.56
7.4.100.0120.00616.42
7.4.90.0070.01016.68
7.4.80.0130.00919.39
7.4.70.0100.00716.42
7.4.60.0130.01016.62
7.4.50.0070.00016.69
7.4.40.0090.00622.77
7.4.30.0040.01216.55
7.4.00.0070.00715.09
7.3.330.0030.00313.42
7.3.320.0050.00013.17
7.3.310.0040.00416.39
7.3.300.0040.00416.33
7.3.290.0030.01016.39
7.3.280.0060.00916.38
7.3.270.0100.00717.40
7.3.260.0090.00916.54
7.3.250.0070.01016.48
7.3.240.0030.01516.41
7.3.230.0060.01016.54
7.3.210.0130.01116.57
7.3.200.0060.01119.39
7.3.190.0130.01016.62
7.3.180.0160.00016.30
7.3.170.0070.01016.63
7.3.160.0090.00916.54
7.3.120.0090.00814.98
7.3.110.0070.00714.78
7.3.100.0060.00714.90
7.3.90.0080.00714.76
7.3.80.0080.00714.78
7.3.70.0020.01314.81
7.3.60.0060.00314.94
7.3.50.0030.01214.82
7.3.40.0090.00414.88
7.3.30.0050.00514.94
7.3.20.0070.00816.68
7.3.10.0060.00716.55
7.3.00.0040.00616.45
7.2.330.0110.00716.85
7.2.320.0200.00317.00
7.2.310.0070.01016.70
7.2.300.0120.00316.89
7.2.290.0140.00316.85
7.2.250.0040.00815.08
7.2.240.0050.01115.19
7.2.230.0040.01315.21
7.2.220.0020.01215.13
7.2.210.0080.00515.02
7.2.200.0030.01215.35
7.2.190.0090.00515.28
7.2.180.0070.00715.15
7.2.170.0020.01315.37
7.2.160.0100.00315.19
7.2.150.0040.01117.07
7.2.140.0050.00517.05
7.2.130.0060.00717.08
7.2.120.0040.01017.08
7.2.110.0050.01016.99
7.2.100.0040.01016.95
7.2.90.0050.00816.95
7.2.80.0100.00417.07
7.2.70.0040.00916.89
7.2.60.0090.00517.09
7.2.50.0080.00516.97
7.2.40.0070.00617.11
7.2.30.0080.00517.12
7.2.20.0100.00617.10
7.2.10.0050.00717.00
7.2.00.0090.00417.04
7.1.330.0030.01215.89
7.1.320.0080.00616.03
7.1.310.0060.00615.92
7.1.300.0070.00615.93
7.1.290.0060.00815.82
7.1.280.0000.01216.04
7.1.270.0060.00715.98
7.1.260.0070.00515.95
7.1.250.0070.00615.88
7.1.200.0030.00615.96
7.1.100.0040.00918.27
7.1.70.0000.00817.39
7.1.60.0090.01519.82
7.1.50.0030.00917.13
7.1.00.0030.07022.29
7.0.200.0060.00616.67
7.0.140.0100.07022.06
7.0.60.0000.09320.03
7.0.50.0100.07717.94
7.0.40.0100.04019.98
7.0.30.0300.07720.22
7.0.20.0170.04020.21
7.0.10.0030.06720.31
7.0.00.0130.07720.10
5.6.280.0070.06720.95
5.6.210.0030.04020.59
5.6.200.0030.04018.19
5.6.190.0000.04720.41
5.6.180.0230.08020.50
5.6.170.0230.07720.47
5.6.160.0100.08020.55
5.6.150.0030.04318.23
5.6.140.0170.04018.28
5.6.130.0130.06718.31
5.6.120.0100.03721.00
5.6.110.0100.06721.00
5.6.100.0130.03321.00
5.6.90.0130.07720.91
5.6.80.0070.03720.43
5.5.350.0270.07720.46
5.5.340.0000.05317.92
5.5.330.0070.06720.57
5.5.320.0200.07020.36
5.5.310.0270.05720.27
5.5.300.0000.08017.99
5.5.290.0000.04317.97
5.5.280.0030.04020.81
5.5.270.0070.05320.85
5.5.260.0170.07020.81
5.5.250.0030.07720.60
5.5.240.0170.06720.21
5.4.450.0600.06719.48
5.4.440.0200.06019.38
5.4.430.0030.06019.41
5.4.420.0130.07019.52
5.4.410.0100.05719.27
5.4.400.0200.05318.85
5.4.390.0030.05718.52
5.4.380.0200.06018.55
5.4.370.0200.05018.84
5.4.360.0170.04718.53
5.4.350.0170.05318.53
5.4.340.0200.05018.53
5.4.320.0080.04612.53
5.4.310.0030.04012.53
5.4.300.0060.04412.53
5.4.290.0080.04612.52
5.4.280.0050.03712.41
5.4.270.0230.05018.88
5.4.260.0170.06318.79
5.4.250.0130.05318.87
5.4.240.0130.04718.96
5.4.230.0130.07718.84
5.4.220.0100.07719.02
5.4.210.0130.07018.95
5.4.200.0200.06018.96
5.4.190.0170.05719.09
5.4.180.0100.06018.90
5.4.170.0200.04719.15
5.4.160.0130.06018.89
5.4.150.0130.06019.04
5.4.140.0170.05016.60
5.4.130.0170.04016.62
5.4.120.0000.05716.67
5.4.110.0070.07316.70
5.4.100.0170.06016.70
5.4.90.0100.05716.40
5.4.80.0070.05316.44
5.4.70.0100.05316.66
5.4.60.0100.06316.51
5.4.50.0100.06716.50
5.4.40.0030.06316.37
5.4.30.0100.05016.64
5.4.20.0100.04716.37
5.4.10.0130.05016.61
5.4.00.0030.06715.82
5.3.290.0060.04412.80
5.3.280.0130.04714.68
5.3.270.0030.06014.81
5.3.260.0130.05714.88
5.3.250.0130.05314.76
5.3.240.0100.07314.91
5.3.230.0130.07014.82
5.3.220.0070.05714.68
5.3.210.0070.07314.87
5.3.200.0130.04714.89
5.3.190.0070.05314.66
5.3.180.0030.05714.82
5.3.170.0000.06314.71
5.3.160.0100.07314.72
5.3.150.0070.07314.48
5.3.140.0070.05014.78
5.3.130.0100.07314.80
5.3.120.0170.04714.78
5.3.110.0200.06314.46
5.3.100.0070.06014.34
5.3.90.0000.07714.25
5.3.80.0030.06014.26
5.3.70.0070.06314.22
5.3.60.0200.05714.30
5.3.50.0200.04314.20
5.3.40.0100.05314.10
5.3.30.0030.07313.99
5.3.20.0100.06313.92
5.3.10.0100.05313.69
5.3.00.0070.05013.55
5.2.170.0070.04711.39
5.2.160.0170.04711.19
5.2.150.0100.04311.24
5.2.140.0130.04011.39
5.2.130.0030.04711.35
5.2.120.0100.05311.45
5.2.110.0030.05011.03
5.2.100.0000.06311.37
5.2.90.0030.04711.26
5.2.80.0200.04011.43
5.2.70.0070.04711.35
5.2.60.0200.04011.29
5.2.50.0030.06311.12
5.2.40.0030.05011.36
5.2.30.0030.06311.01
5.2.20.0000.06011.18
5.2.10.0030.04711.08
5.2.00.0070.04010.98
5.1.60.0100.04310.36
5.1.50.0100.03310.36
5.1.40.0000.04310.17
5.1.30.0070.04310.43
5.1.20.0130.04710.71
5.1.10.0070.04010.11
5.1.00.0130.03310.28
5.0.50.0030.0408.67
5.0.40.0030.0338.77
5.0.30.0100.0408.36
5.0.20.0030.0308.43
5.0.10.0030.0308.50
5.0.00.0100.0378.19
4.4.90.0000.0277.27
4.4.80.0030.0237.27
4.4.70.0000.0277.27
4.4.60.0000.0237.27
4.4.50.0030.0307.27
4.4.40.0030.0507.27
4.4.30.0070.0177.27
4.4.20.0030.0237.27
4.4.10.0030.0307.27
4.4.00.0070.0277.27
4.3.110.0000.0337.27
4.3.100.0030.0307.27
4.3.90.0130.0207.27
4.3.80.0030.0507.27
4.3.70.0030.0237.27
4.3.60.0070.0177.27
4.3.50.0030.0237.27
4.3.40.0000.0437.27
4.3.30.0070.0277.27
4.3.20.0030.0277.27
4.3.10.0070.0237.27
4.3.00.0170.0207.18

preferences:
45.66 ms | 401 KiB | 5 Q