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(\"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.0150.00018.77
8.3.30.0120.00319.05
8.3.20.0040.00420.19
8.3.10.0050.00322.10
8.3.00.0050.00322.34
8.2.170.0040.01122.96
8.2.160.0070.00719.29
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00317.48
8.2.110.0060.00322.19
8.2.100.0110.00017.91
8.2.90.0000.00819.22
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0040.00418.28
8.2.30.0030.00718.07
8.2.20.0000.00817.86
8.2.10.0060.00319.48
8.2.00.0040.00517.68
8.1.270.0080.00022.31
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0090.00319.29
8.1.220.0040.00417.88
8.1.210.0040.00418.77
8.1.200.0070.00317.48
8.1.190.0000.00817.65
8.1.180.0040.00418.10
8.1.170.0030.00718.77
8.1.160.0040.00422.11
8.1.150.0040.00418.77
8.1.140.0040.00417.55
8.1.130.0030.00517.83
8.1.120.0000.00717.59
8.1.110.0050.00217.50
8.1.100.0000.00717.55
8.1.90.0050.00217.50
8.1.80.0000.00817.52
8.1.70.0030.00317.48
8.1.60.0060.00317.67
8.1.50.0040.00417.54
8.1.40.0000.00817.64
8.1.30.0040.00417.72
8.1.20.0080.00017.78
8.1.10.0050.00317.50
8.1.00.0040.00417.41
8.0.300.0030.00318.77
8.0.290.0070.00017.18
8.0.280.0030.00318.59
8.0.270.0070.00017.33
8.0.260.0000.00716.86
8.0.250.0040.00416.99
8.0.240.0080.00017.12
8.0.230.0000.00716.98
8.0.220.0040.00417.07
8.0.210.0060.00316.91
8.0.200.0030.00317.09
8.0.190.0000.00717.04
8.0.180.0030.00516.89
8.0.170.0040.00417.09
8.0.160.0040.00417.01
8.0.150.0030.00616.92
8.0.140.0000.00716.86
8.0.130.0030.00313.49
8.0.120.0000.00816.98
8.0.110.0000.00816.98
8.0.100.0040.00416.91
8.0.90.0000.00716.91
8.0.80.0160.00617.04
8.0.70.0000.00717.09
8.0.60.0000.00716.82
8.0.50.0040.00416.89
8.0.30.0070.01317.15
8.0.20.0100.00917.40
8.0.10.0030.00517.11
8.0.00.0110.00817.04
7.4.330.0000.00515.00
7.4.320.0030.00316.49
7.4.300.0030.00316.57
7.4.290.0070.00016.69
7.4.280.0000.00816.67
7.4.270.0080.00016.56
7.4.260.0020.00816.45
7.4.250.0040.00416.55
7.4.240.0050.00216.60
7.4.230.0030.00316.76
7.4.220.0120.00616.74
7.4.210.0110.00516.52
7.4.200.0040.00416.67
7.4.190.0030.00416.82
7.4.160.0130.00316.61
7.4.150.0090.01517.40
7.4.140.0050.01217.86
7.4.130.0100.00816.72
7.4.120.0100.00916.57
7.4.110.0080.01216.60
7.4.100.0070.01116.67
7.4.90.0100.00716.51
7.4.80.0080.01219.39
7.4.70.0160.00016.66
7.4.60.0070.01016.48
7.4.50.0030.00616.43
7.4.40.0030.00622.77
7.4.30.0000.01616.78
7.4.00.0100.00814.99
7.3.330.0000.00613.41
7.3.320.0030.00313.43
7.3.310.0000.00716.45
7.3.300.0070.00016.42
7.3.290.0090.00616.45
7.3.280.0110.00516.36
7.3.270.0090.00917.40
7.3.260.0030.01316.51
7.3.250.0100.00916.58
7.3.240.0120.00616.47
7.3.230.0080.00816.59
7.3.210.0060.01016.44
7.3.200.0070.01419.39
7.3.190.0100.00716.37
7.3.180.0100.00616.65
7.3.170.0100.00516.47
7.3.160.0080.00816.30
7.3.120.0090.00814.92
7.3.110.0020.01614.96
7.3.100.0050.01014.94
7.3.90.0060.00814.91
7.3.80.0080.00514.77
7.3.70.0030.01014.98
7.3.60.0070.00714.72
7.3.50.0050.00514.79
7.3.40.0100.00314.90
7.3.30.0060.00614.95
7.3.20.0030.00916.62
7.3.10.0070.00616.56
7.3.00.0060.00816.44
7.2.330.0070.00916.69
7.2.320.0100.00716.73
7.2.310.0080.00816.82
7.2.300.0140.00316.94
7.2.290.0080.00816.91
7.2.250.0060.01315.23
7.2.240.0100.00815.32
7.2.230.0090.00815.44
7.2.220.0040.01315.37
7.2.210.0060.00815.40
7.2.200.0020.01115.34
7.2.190.0050.00915.23
7.2.180.0050.01015.32
7.2.170.0040.01015.17
7.2.130.0180.00817.02
7.2.120.0100.00716.69
7.2.110.0130.01016.49
7.2.100.0110.00916.48
7.2.90.0070.01317.20
7.2.80.0090.00816.98
7.2.70.0100.01416.82
7.2.60.0080.00816.82
7.2.50.0170.00016.84
7.2.40.0160.00916.84
7.2.30.0150.00316.45
7.2.20.0180.01016.48
7.2.10.0240.00717.18
7.2.00.0070.01218.13
7.1.330.0100.00516.01
7.1.320.0060.00715.93
7.1.310.0070.00715.83
7.1.300.0070.00315.68
7.1.290.0060.00915.86
7.1.280.0030.01115.90
7.1.270.0040.00815.77
7.1.260.0030.00815.88
7.1.250.0080.01615.98
7.1.200.0030.00615.68
7.1.100.0040.01117.98
7.1.70.0070.00717.38
7.1.60.0150.00319.82
7.1.50.0140.01017.16
7.1.00.0070.07322.56
7.0.200.0060.00917.02
7.0.140.0030.07722.18
7.0.60.0000.06320.00
7.0.50.0070.07718.01
7.0.40.0070.07720.14
7.0.30.0430.05320.11
7.0.20.0230.09020.34
7.0.10.0200.06320.16
7.0.00.0000.04320.34
5.6.280.0000.07721.09
5.6.210.0130.07020.77
5.6.200.0030.09018.19
5.6.190.0100.06720.69
5.6.180.4130.03320.61
5.6.170.0330.06720.51
5.6.160.0030.04020.46
5.6.150.0000.08718.14
5.6.140.0130.03318.18
5.6.130.0100.07318.24
5.6.120.0070.03721.14
5.6.110.0070.07021.14
5.6.100.0070.08321.03
5.6.90.0170.08021.13
5.6.80.0030.04020.40
5.6.70.0330.05320.38
5.5.350.0100.07720.35
5.5.340.0030.05718.02
5.5.330.0100.03720.25
5.5.320.0270.07320.35
5.5.310.0230.08020.38
5.5.300.0070.08317.96
5.5.290.0070.03718.07
5.5.280.0130.07720.92
5.5.270.0130.08020.89
5.5.260.0200.06320.70
5.5.250.0130.08020.60
5.5.240.0100.06020.14
5.4.450.0800.06319.63
5.4.440.0770.05319.32
5.4.430.0100.05319.23
5.4.420.0070.05719.46
5.4.410.0170.04719.35
5.4.400.0100.05018.61
5.4.390.0100.05018.60
5.4.380.0200.05718.63
5.4.370.0230.05318.77
5.4.360.0200.05718.84
5.4.350.0170.06318.79
5.4.340.0070.06318.60
5.4.320.0070.03612.52
5.4.310.0110.03912.52
5.4.300.0070.04512.52
5.4.290.0100.04712.52
5.4.280.0070.03512.41
5.4.270.0130.07018.91
5.4.260.0100.06019.13
5.4.250.0100.07319.08
5.4.240.0030.07719.00
5.4.230.0130.06318.93
5.4.220.0070.07018.91
5.4.210.0030.09018.99
5.4.200.0070.07718.94
5.4.190.0200.07319.01
5.4.180.0130.05319.09
5.4.170.0200.06319.08
5.4.160.0100.05718.90
5.4.150.0130.06719.13
5.4.140.0100.06716.70
5.4.130.0030.07016.72
5.4.120.0030.07316.69
5.4.110.0130.05716.49
5.4.100.0070.05716.73
5.4.90.0030.06716.51
5.4.80.0100.07016.70
5.4.70.0030.07316.46
5.4.60.0130.06016.67
5.4.50.0170.06316.64
5.4.40.0270.04716.56
5.4.30.0070.05016.41
5.4.20.0100.04716.39
5.4.10.0200.06016.52
5.4.00.0130.06315.89
5.3.290.0090.03712.80
5.3.280.0100.07014.51
5.3.270.0230.06014.81
5.3.260.0170.06714.91
5.3.250.0130.06714.92
5.3.240.0170.04714.91
5.3.230.0070.05714.93
5.3.220.0130.07014.82
5.3.210.0100.07014.67
5.3.200.0130.04714.90
5.3.190.0170.04314.90
5.3.180.0100.05014.86
5.3.170.0100.06714.65
5.3.160.0100.06014.86
5.3.150.0230.06014.89
5.3.140.0070.07014.66
5.3.130.0100.07014.78
5.3.120.0070.06014.64
5.3.110.0100.07314.86
5.3.100.0100.07014.07
5.3.90.0030.07714.07
5.3.80.0030.06014.25
5.3.70.0130.04314.10
5.3.60.0000.07714.24
5.3.50.0100.06314.18
5.3.40.0200.06314.16
5.3.30.0100.05314.12
5.3.20.0030.05313.94
5.3.10.0030.07313.86
5.3.00.0030.06313.87
5.2.170.0030.05011.46
5.2.160.0030.04711.38
5.2.150.0070.06011.25
5.2.140.0070.04711.17
5.2.130.0070.06011.43
5.2.120.0070.04011.26
5.2.110.0030.05011.32
5.2.100.0100.05011.18
5.2.90.0070.05011.20
5.2.80.0070.04311.34
5.2.70.0070.05011.34
5.2.60.0170.04011.30
5.2.50.0070.05711.17
5.2.40.0070.04711.10
5.2.30.0070.05311.20
5.2.20.0070.05711.00
5.2.10.0000.05711.07
5.2.00.0170.05010.95
5.1.60.0070.04010.13
5.1.50.0100.03710.04
5.1.40.0030.04010.32
5.1.30.0070.03710.36
5.1.20.0000.06010.60
5.1.10.0030.04010.15
5.1.00.0100.04310.33
5.0.50.0030.0408.74
5.0.40.0100.0378.53
5.0.30.0000.0508.16
5.0.20.0070.0378.52
5.0.10.0030.0438.26
5.0.00.0070.0508.22
4.4.90.0030.0307.11
4.4.80.0100.0207.11
4.4.70.0070.0177.11
4.4.60.0000.0277.11
4.4.50.0130.0237.11
4.4.40.0030.0437.11
4.4.30.0030.0207.11
4.4.20.0000.0337.11
4.4.10.0030.0237.11
4.4.00.0200.0307.11
4.3.110.0000.0307.11
4.3.100.0130.0107.11
4.3.90.0030.0307.11
4.3.80.0070.0377.11
4.3.70.0030.0207.11
4.3.60.0000.0337.11
4.3.50.0000.0277.11
4.3.40.0000.0377.11
4.3.30.0000.0307.25
4.3.20.0030.0277.25
4.3.10.0070.0237.25
4.3.00.0100.0277.38

preferences:
40.36 ms | 400 KiB | 5 Q