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) { echo "THIS IS ONE EXEC\n"; 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.0140.00018.81
8.3.50.0140.00721.92
8.3.40.0060.01018.76
8.3.30.0060.00919.08
8.3.20.0040.00420.13
8.3.10.0080.00021.80
8.3.00.0040.00422.46
8.2.180.0180.00016.63
8.2.170.0110.01122.96
8.2.160.0070.01119.34
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00319.36
8.2.110.0040.00722.25
8.2.100.0040.00819.64
8.2.90.0090.00019.36
8.2.80.0050.00318.05
8.2.70.0000.00817.63
8.2.60.0080.00017.80
8.2.50.0030.00518.07
8.2.40.0090.00018.16
8.2.30.0110.00018.13
8.2.20.0030.00517.78
8.2.10.0040.00419.58
8.2.00.0040.00417.87
8.1.280.0100.00725.92
8.1.270.0090.00022.16
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00723.84
8.1.230.0040.00718.95
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0040.00717.47
8.1.190.0000.00817.66
8.1.180.0030.00518.10
8.1.170.0040.00418.68
8.1.160.0000.00721.99
8.1.150.0000.00818.66
8.1.140.0060.00317.52
8.1.130.0080.00017.93
8.1.120.0070.00017.41
8.1.110.0030.00517.41
8.1.100.0000.00717.55
8.1.90.0040.00417.37
8.1.80.0050.00317.37
8.1.70.0000.00717.43
8.1.60.0040.00417.50
8.1.50.0000.00717.48
8.1.40.0040.00417.55
8.1.30.0000.00817.62
8.1.20.0040.00417.69
8.1.10.0030.00617.61
8.1.00.0040.00417.64
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0000.00818.43
8.0.270.0070.00017.37
8.0.260.0030.00316.94
8.0.250.0040.00317.09
8.0.240.0000.00717.16
8.0.230.0000.00716.97
8.0.220.0000.00716.95
8.0.210.0060.00317.00
8.0.200.0030.00317.06
8.0.190.0000.00717.08
8.0.180.0040.00416.93
8.0.170.0050.00317.09
8.0.160.0000.00717.07
8.0.150.0050.00316.91
8.0.140.0080.00017.01
8.0.130.0000.00513.40
8.0.120.0000.00816.95
8.0.110.0040.00416.99
8.0.100.0040.00417.05
8.0.90.0040.00417.01
8.0.80.0100.00516.94
8.0.70.0000.00817.01
8.0.60.0040.00416.93
8.0.50.0040.00417.04
8.0.30.0120.00816.94
8.0.20.0110.00817.40
8.0.10.0030.00517.05
8.0.00.0090.01216.92
7.4.330.0030.00315.09
7.4.320.0030.00316.56
7.4.300.0070.00016.55
7.4.290.0070.00016.67
7.4.280.0000.00716.66
7.4.270.0000.00716.65
7.4.260.0000.00716.45
7.4.250.0000.00816.46
7.4.240.0040.00416.55
7.4.230.0040.00416.64
7.4.220.0000.01816.62
7.4.210.0050.01416.63
7.4.200.0040.00416.61
7.4.190.0070.00016.71
7.4.160.0090.00916.47
7.4.150.0100.01017.40
7.4.140.0090.00817.86
7.4.130.0120.00716.65
7.4.120.0060.01216.61
7.4.110.0130.00316.79
7.4.100.0090.00916.57
7.4.90.0110.00616.64
7.4.80.0070.01019.39
7.4.70.0130.00316.64
7.4.60.0070.01016.57
7.4.50.0030.00616.37
7.4.40.0150.00322.77
7.4.30.0090.00916.71
7.4.10.0110.00414.88
7.4.00.0070.01114.94
7.3.330.0060.00013.41
7.3.320.0050.00013.16
7.3.310.0030.00316.26
7.3.300.0070.00016.28
7.3.290.0070.00716.33
7.3.280.0090.00916.40
7.3.270.0140.01017.40
7.3.260.0120.00616.52
7.3.250.0110.00916.58
7.3.240.0070.01016.46
7.3.230.0070.01016.43
7.3.210.0070.01016.43
7.3.200.0100.00919.39
7.3.190.0070.01016.54
7.3.180.0080.01216.52
7.3.170.0100.00716.45
7.3.160.0070.01016.45
7.3.130.0100.01014.87
7.3.120.0060.01114.77
7.3.110.0130.00614.71
7.3.100.0070.00714.89
7.3.90.0020.01514.74
7.3.80.0090.00414.69
7.3.70.0060.00914.78
7.3.60.0080.00714.59
7.3.50.0100.00414.94
7.3.40.0060.00814.52
7.3.30.0060.00614.64
7.3.20.0040.00716.64
7.3.10.0070.00816.58
7.3.00.0080.00616.63
7.2.330.0100.01016.78
7.2.320.0110.01417.02
7.2.310.0100.01016.90
7.2.300.0080.00816.78
7.2.290.0160.00316.89
7.2.260.0130.00415.45
7.2.250.0060.01015.16
7.2.240.0050.01315.10
7.2.230.0050.01415.16
7.2.220.0050.01215.24
7.2.210.0020.01815.02
7.2.200.0060.01015.18
7.2.190.0050.01015.32
7.2.180.0030.01415.15
7.2.170.0080.00715.13
7.2.160.0080.00814.90
7.2.150.0070.00316.95
7.2.140.0110.00416.96
7.2.130.0070.01016.86
7.2.120.0040.01116.94
7.2.110.0070.00717.20
7.2.100.0030.01416.80
7.2.90.0100.01017.16
7.2.80.0100.00616.93
7.2.70.0120.00317.04
7.2.60.0130.00416.85
7.2.50.0090.00616.71
7.2.40.0000.01117.14
7.2.30.0090.00916.61
7.2.20.0030.01416.89
7.2.10.0000.01517.02
7.2.00.0080.00718.41
7.1.330.0100.00316.02
7.1.320.0070.00615.79
7.1.310.0070.00815.86
7.1.300.0070.00615.75
7.1.290.0030.01015.86
7.1.280.0070.00815.79
7.1.270.0050.01015.71
7.1.260.0060.00815.74
7.1.250.0060.00615.81
7.1.240.0140.00015.96
7.1.230.0030.01015.83
7.1.220.0060.01015.80
7.1.210.0030.01215.50
7.1.200.0080.00716.05
7.1.190.0080.00815.64
7.1.180.0030.01315.51
7.1.170.0100.00615.72
7.1.160.0040.01116.07
7.1.150.0110.00316.06
7.1.140.0040.01115.90
7.1.130.0110.00315.96
7.1.120.0040.01015.67
7.1.110.0050.00515.97
7.1.100.0070.00516.93
7.1.90.0040.01115.77
7.1.80.0030.01215.93
7.1.70.0020.01216.56
7.1.60.0030.01417.69
7.1.50.0070.01116.58
7.1.40.0080.00415.75
7.1.30.0080.00815.42
7.1.20.0060.00915.79
7.1.10.0030.00915.70
7.1.00.0070.03819.10
7.0.330.0140.00015.27
7.0.320.0000.01215.18
7.0.310.0000.00915.39
7.0.300.0080.00815.37
7.0.290.0000.01115.46
7.0.280.0040.01115.66
7.0.270.0120.00315.13
7.0.260.0080.00415.78
7.0.250.0080.00815.63
7.0.240.0040.00715.38
7.0.230.0140.00015.20
7.0.220.0040.00815.50
7.0.210.0000.01015.65
7.0.200.0050.00915.99
7.0.190.0030.01315.53
7.0.180.0060.00315.42
7.0.170.0050.00815.38
7.0.160.0060.00615.39
7.0.150.0060.00615.37
7.0.140.0090.03718.79
7.0.130.0080.00515.50
7.0.120.0060.00915.58
7.0.110.0100.00315.07
7.0.100.0030.01415.20
7.0.90.0070.01015.63
7.0.80.0060.00915.26
7.0.70.0060.01015.40
7.0.60.0100.04117.65
7.0.50.0030.04616.75
7.0.40.0090.04316.76
7.0.30.0100.02716.64
7.0.20.0120.02916.86
7.0.10.0020.03216.64
7.0.00.0050.03916.83
5.6.400.0000.01014.37
5.6.390.0030.01014.34
5.6.380.0040.00814.40
5.6.370.0000.01514.30
5.6.360.0100.00714.16
5.6.350.0040.01214.41
5.6.340.0000.01414.16
5.6.330.0030.01014.74
5.6.320.0040.01114.35
5.6.310.0100.00514.52
5.6.300.0040.00814.32
5.6.290.0000.01514.34
5.6.280.0050.04117.77
5.6.270.0060.00914.37
5.6.260.0060.00914.13
5.6.250.0070.01014.40
5.6.240.0120.00014.17
5.6.230.0090.01114.21
5.6.220.0080.00614.01
5.6.210.0100.03617.39
5.6.200.0060.02316.28
5.6.190.0040.03217.28
5.6.180.0270.04117.34
5.6.170.0170.03017.36
5.6.160.0270.01917.22
5.6.150.0070.02016.08
5.6.140.0050.03716.20
5.6.130.0020.03416.26
5.6.120.0110.04517.69
5.6.110.0070.04317.67
5.6.100.0100.04017.58
5.6.90.0100.04317.65
5.6.80.0080.04217.38
5.6.70.0000.01414.23
5.6.60.0030.01414.20
5.6.50.0060.00914.64
5.6.40.0060.00614.08
5.6.30.0030.01314.18
5.6.20.0080.00514.32
5.6.10.0090.00614.09
5.6.00.0060.00913.99
5.5.380.0090.00913.96
5.5.370.0060.00814.09
5.5.360.0040.01414.36
5.5.350.0130.04717.34
5.5.340.0030.04716.11
5.5.330.0070.04617.39
5.5.320.0230.04217.32
5.5.310.0110.02817.33
5.5.300.0090.03516.03
5.5.290.0100.01816.18
5.5.280.0080.04717.58
5.5.270.0090.04017.75
5.5.260.0130.01817.59
5.5.250.0120.02217.25
5.5.240.0150.04217.33
5.5.230.0070.00714.18
5.5.220.0100.00314.10
5.5.210.0030.01613.91
5.5.200.0030.01214.29
5.5.190.0070.00714.14
5.5.180.0070.00414.50
5.5.170.0020.01314.30
5.5.160.0090.00614.14
5.5.150.0120.00314.09
5.5.140.0040.00714.12
5.5.130.0040.01114.25
5.5.120.0070.00714.46
5.5.110.0060.00614.19
5.5.100.0070.00713.79
5.5.90.0040.00814.24
5.5.80.0060.00914.23
5.5.70.0030.01414.02
5.5.60.0070.00713.93
5.5.50.0030.01214.45
5.5.40.0000.01114.38
5.5.30.0070.01013.89
5.5.20.0030.01014.02
5.5.10.0030.01013.95
5.5.00.0070.00413.59
5.4.450.0060.04115.30
5.4.440.0080.04415.31
5.4.430.0180.02015.44
5.4.420.0110.03915.26
5.4.410.0090.03315.24
5.4.400.0090.02715.38
5.4.390.0050.04215.02
5.4.380.0100.04214.96
5.4.370.0120.03215.07
5.4.360.0100.03715.13
5.4.350.0080.04015.13
5.4.340.0110.03914.91
5.4.330.0030.00611.08
5.4.320.0110.03815.04
5.4.310.0070.04415.10
5.4.300.0180.02315.23
5.4.290.0120.02314.96
5.4.280.0080.04315.04
5.4.270.0150.03014.95
5.4.260.0170.02815.36
5.4.250.0150.03015.20
5.4.240.0190.03515.09
5.4.230.0120.03915.17
5.4.220.0080.02115.24
5.4.210.0110.02315.14
5.4.200.0050.03015.09
5.4.190.0120.03914.89
5.4.180.0060.03914.95
5.4.170.0130.03115.09
5.4.160.0050.04214.95
5.4.150.0060.03814.97
5.4.140.0070.02913.59
5.4.130.0050.02213.78
5.4.120.0090.03313.71
5.4.110.0070.02013.85
5.4.100.0060.03613.71
5.4.90.0040.02913.93
5.4.80.0030.04113.83
5.4.70.0000.02913.88
5.4.60.0070.02213.78
5.4.50.0070.03713.83
5.4.40.0080.03513.85
5.4.30.0010.04113.79
5.4.20.0050.03513.71
5.4.10.0040.02413.93
5.4.00.0020.02613.67
5.3.290.0050.02412.94
5.3.280.0130.03312.89
5.3.270.0050.04312.98
5.3.260.0050.04412.94
5.3.250.0070.02812.77
5.3.240.0100.03812.88
5.3.230.0050.04212.88
5.3.220.0040.02912.79
5.3.210.0080.03712.82
5.3.200.0030.02312.79
5.3.190.0020.04212.84
5.3.180.0020.03412.88
5.3.170.0070.03712.79
5.3.160.0080.03812.87
5.3.150.0080.02512.86
5.3.140.0050.03212.77
5.3.130.0040.03012.87
5.3.120.0000.04512.79
5.3.110.0080.03812.73
5.3.100.0050.03312.86
5.3.90.0020.04012.76
5.3.80.0050.04012.88
5.3.70.0060.03712.88
5.3.60.0050.04012.76
5.3.50.0010.04112.72
5.3.40.0040.04012.79
5.3.30.0070.02412.86
5.3.20.0050.02512.86
5.3.10.0070.03112.78
5.3.00.0040.04112.74
5.2.170.0030.04015.05
5.2.160.0000.06015.05
5.2.150.0000.06315.05
5.2.140.0070.03315.05
5.2.130.0070.03015.05
5.2.120.0000.06715.05
5.2.110.0030.04715.05
5.2.100.0000.04015.05
5.2.90.0030.05315.05
5.2.80.0100.03715.05
5.2.70.0070.05715.05
5.2.60.0070.06315.05
5.2.50.0030.06015.05
5.2.40.0030.06015.05
5.2.30.0030.06015.05
5.2.20.0100.04715.05
5.2.10.0070.05715.05
5.2.00.0070.02315.05
5.1.60.0000.05015.05
5.1.50.0030.02715.05
5.1.40.0030.05315.05
5.1.30.0070.05715.05
5.1.20.0000.05715.05
5.1.10.0030.04315.05
5.1.00.0000.05015.05
5.0.50.0000.03715.05
5.0.40.0000.03015.05
5.0.30.0000.05715.05
5.0.20.0000.04715.05
5.0.10.0030.03715.05
5.0.00.0070.05715.05
4.4.90.0000.03715.05
4.4.80.0070.01715.05
4.4.70.0000.03715.05
4.4.60.0030.01715.05
4.4.50.0000.01715.05
4.4.40.0000.03715.05
4.4.30.0000.01715.05
4.4.20.0000.03015.05
4.4.10.0030.02715.05
4.4.00.0000.05315.05
4.3.110.0030.02015.05
4.3.100.0030.02015.05
4.3.90.0070.03015.05
4.3.80.0030.04715.05
4.3.70.0070.02715.05
4.3.60.0000.03715.05
4.3.50.0030.02715.05
4.3.40.0030.02715.05
4.3.30.0000.03315.05
4.3.20.0000.02315.05
4.3.10.0000.04015.05
4.3.00.0000.03315.05

preferences:
53.62 ms | 401 KiB | 5 Q