3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MemoryFile { private static $data = ""; private static $pos = 0; public function stream_open() { self::$pos = 0; return true; } public function stream_read($count) { return substr(self::$data, (self::$pos += $count) - $count, $count); } public function stream_write($data) { self::$data = substr(self::$data, 0, self::$pos) . $data; self::$pos += strlen($data); return strlen($data); } public function stream_tell() { return self::$pos; } public function stream_eof() { return self::$pos >= strlen(self::$data); } public function stream_stat() { return []; } } stream_wrapper_register("foo", "MemoryFile"); file_put_contents("foo://bar", <<<'PHTML' <?php // view.phtml echo "<html><head><title>$this->data</title></head><body></body></html>"; PHTML ); // View.php class View { private $data = 'test'; public function render() { require 'foo://bar'; } } (new View)->render();

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.0070.01116.88
8.3.60.0120.00618.43
8.3.50.0110.00418.21
8.3.40.0120.00618.92
8.3.30.0030.01218.84
8.3.20.0080.00021.94
8.3.10.0000.00721.65
8.3.00.0080.00019.81
8.2.190.0130.00318.55
8.2.180.0190.00318.79
8.2.170.0170.00322.96
8.2.160.0030.01019.29
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00719.08
8.2.120.0040.00426.35
8.2.110.0030.00621.13
8.2.100.0120.00017.78
8.2.90.0030.00518.03
8.2.80.0000.00918.15
8.2.70.0000.00817.80
8.2.60.0080.00018.05
8.2.50.0020.00518.28
8.2.40.0000.00820.41
8.2.30.0060.00619.21
8.2.20.0000.00818.02
8.2.10.0040.00418.02
8.2.00.0000.00718.04
8.1.280.0090.00925.92
8.1.270.0040.00422.05
8.1.260.0000.00826.35
8.1.250.0000.00928.09
8.1.240.0070.00322.59
8.1.230.0090.00321.03
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00817.35
8.1.190.0050.00317.36
8.1.180.0000.00818.10
8.1.170.0040.00418.41
8.1.160.0030.00618.82
8.1.150.0030.00520.79
8.1.140.0030.00517.73
8.1.130.0000.00819.05
8.1.120.0040.00317.46
8.1.110.0000.00717.49
8.1.100.0040.00417.50
8.1.90.0050.00317.48
8.1.80.0050.00317.37
8.1.70.0000.00717.54
8.1.60.0040.00417.61
8.1.50.0000.01417.62
8.1.40.0060.00317.50
8.1.30.0030.00517.72
8.1.20.0050.00217.65
8.1.10.0040.00417.62
8.1.00.0040.00417.52
8.0.300.0040.00420.00
8.0.290.0070.00016.75
8.0.280.0070.00018.45
8.0.270.0040.00417.34
8.0.260.0050.00317.34
8.0.250.0000.00717.09
8.0.240.0040.00417.04
8.0.230.0000.00717.09
8.0.220.0050.00216.99
8.0.210.0030.00317.00
8.0.200.0030.00317.11
8.0.190.0030.00517.14
8.0.180.0070.00017.06
8.0.170.0030.00617.04
8.0.160.0080.00017.14
8.0.150.0000.00716.87
8.0.140.0000.00716.88
8.0.130.0030.00313.51
8.0.120.0060.00317.01
8.0.110.0050.00217.05
8.0.100.0030.00516.98
8.0.90.0000.00816.91
8.0.80.0120.00417.04
8.0.70.0050.00317.03
8.0.60.0030.00516.94
8.0.50.0000.00816.93
8.0.30.0090.01517.04
8.0.20.0180.00417.40
8.0.10.0020.00517.13
8.0.00.0120.00516.73
7.4.330.0000.00516.77
7.4.320.0060.00016.53
7.4.300.0060.00016.52
7.4.290.0030.00316.57
7.4.280.0000.00816.61
7.4.270.0070.00016.50
7.4.260.0000.00716.52
7.4.250.0040.00416.63
7.4.240.0080.00016.55
7.4.230.0030.00316.61
7.4.220.0070.00016.27
7.4.210.0070.00816.51
7.4.200.0030.00316.34
7.4.160.0120.00416.56
7.4.140.0100.01017.86
7.4.130.0090.00816.55
7.4.120.0100.00816.51
7.4.110.0100.00616.66
7.4.100.0080.00816.56
7.4.90.0030.01416.52
7.4.80.0090.01319.39
7.4.70.0100.00716.53
7.4.60.0090.00916.52
7.4.50.0060.00916.67
7.4.40.0210.00016.35
7.4.00.0070.01115.02
7.3.330.0000.00513.50
7.3.320.0000.00613.37
7.3.310.0070.00016.48
7.3.300.0070.00016.53
7.3.290.0030.00316.38
7.3.280.0090.00816.46
7.3.260.0110.00616.50
7.3.240.0120.00716.63
7.3.230.0090.01216.55
7.3.210.0140.00316.48
7.3.200.0160.00316.52
7.3.190.0170.00016.45
7.3.180.0100.00716.49
7.3.170.0110.00616.61
7.3.160.0080.00816.46
7.3.120.0030.01614.86
7.3.110.0040.01114.84
7.3.100.0030.01414.99
7.3.90.0140.00314.61
7.3.80.0070.00314.81
7.3.70.0030.01014.87
7.3.60.0030.01314.56
7.3.50.0030.01414.77
7.3.40.0060.00614.84
7.3.30.0040.01114.74
7.3.20.0100.00716.78
7.3.10.0080.00416.60
7.3.00.0060.00716.48
7.2.330.0130.01016.84
7.2.320.0030.01416.48
7.2.310.0100.00716.70
7.2.300.0130.00316.69
7.2.290.0100.01316.77
7.2.250.0030.01714.86
7.2.240.0160.00315.05
7.2.230.0040.01515.16
7.2.220.0140.00414.79
7.2.210.0070.00714.81
7.2.200.0060.00614.99
7.2.190.0070.00715.00
7.2.180.0040.01114.93
7.2.170.0090.00315.14
7.2.130.0090.00316.97
7.2.120.0080.00416.97
7.2.110.0060.00717.00
7.2.100.0090.00317.00
7.2.90.0030.01017.11
7.2.80.0090.00616.96
7.2.70.0060.00816.81
7.2.60.0050.01016.90
7.2.50.0070.00616.93
7.2.40.0340.01317.49
7.2.30.0250.01017.37
7.2.20.0300.00817.27
7.2.10.0370.00717.28
7.2.00.0330.00817.26
7.1.330.0070.00615.85
7.1.320.0040.00915.79
7.1.310.0030.00915.78
7.1.300.0070.00715.85
7.1.290.0070.01015.55
7.1.280.0070.00415.83
7.1.270.0060.00615.82
7.1.260.0040.00715.62
7.1.250.0030.00615.67
7.1.200.0070.00315.63
7.1.160.0780.01217.20
7.1.150.0640.01317.09
7.1.140.0800.01217.04
7.1.130.0850.00916.84
7.1.120.0730.00717.08
7.1.110.1000.01216.48
7.1.100.0740.01116.09
7.1.90.1010.00816.35
7.1.80.0930.00916.52
7.1.70.0130.00715.27
7.1.60.0890.01533.45
7.1.50.1150.01233.10
7.1.40.1000.01432.56
7.1.30.1330.02132.62
7.1.20.1330.01932.77
7.1.10.0910.01014.97
7.1.00.1330.01015.09

preferences:
31.19 ms | 401 KiB | 5 Q