3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SourceTransformingLoader extends php_user_filter { /** * Php filter definition */ const PHP_FILTER_READ = 'php://filter/read='; /** * Default PHP filter name for registration */ const FILTER_IDENTIFIER = 'go.source.transforming.loader'; /** * String buffer * * @var string */ protected $data = ''; /** * Identifier of filter * * @var string */ protected static $filterId; /** * Register current loader as stream filter in PHP * * @param string $filterId Identifier for the filter * @throws \RuntimeException If registration was failed */ public static function register($filterId = self::FILTER_IDENTIFIER) { if (!empty(self::$filterId)) { throw new RuntimeException('Stream filter already registered'); } $result = stream_filter_register($filterId, __CLASS__); if (!$result) { throw new RuntimeException('Stream filter was not registered'); } self::$filterId = $filterId; } /** * {@inheritdoc} */ public function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $this->data .= $bucket->data; } if ($closing || feof($this->stream)) { $consumed = strlen($this->data); $bucket = stream_bucket_new($this->stream, strtoupper($this->data)); stream_bucket_append($out, $bucket); return PSFS_PASS_ON; } return PSFS_FEED_ME; } } SourceTransformingLoader::register(); function autoload($className) { echo file_get_contents('php://filter/read=go.source.transforming.loader/resource=' . __FILE__); eval("class $className {}"); } function shutdown() { $test = new TestClass(); // trigger autoload } register_shutdown_function('shutdown'); spl_autoload_register('autoload');

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.0090.00916.72
8.3.50.0260.00622.00
8.3.40.0040.01118.95
8.3.30.0100.01019.25
8.3.20.0000.00820.25
8.3.10.0040.00423.47
8.3.00.0080.00022.44
8.2.180.0090.00616.63
8.2.170.0120.00322.96
8.2.160.0100.00320.52
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00022.13
8.2.110.0100.00019.27
8.2.100.0130.00017.91
8.2.90.0030.00519.15
8.2.80.0000.00917.97
8.2.70.0090.00317.36
8.2.60.0080.00017.80
8.2.50.0050.00318.07
8.2.40.0060.00319.38
8.2.30.0040.00418.02
8.2.20.0060.00317.75
8.2.10.0030.00519.41
8.2.00.0000.00817.83
8.1.280.0100.01025.92
8.1.270.0030.00623.84
8.1.260.0030.00626.35
8.1.250.0030.00728.09
8.1.240.0050.00521.99
8.1.230.0090.00322.65
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0000.00917.35
8.1.190.0020.00517.66
8.1.180.0030.00518.10
8.1.170.0060.00318.64
8.1.160.0030.00521.96
8.1.150.0060.00318.73
8.1.140.0030.00617.49
8.1.130.0070.00017.83
8.1.120.0040.00417.42
8.1.110.0000.00917.53
8.1.100.0070.00017.50
8.1.90.0020.00517.38
8.1.80.0040.00417.55
8.1.70.0000.00717.43
8.1.60.0030.00617.66
8.1.50.0030.00617.55
8.1.40.0000.00717.45
8.1.30.0030.00617.59
8.1.20.0080.00017.62
8.1.10.0000.00817.63
8.1.00.0090.00017.44
8.0.300.0050.00318.77
8.0.290.0000.00816.75
8.0.280.0030.00318.59
8.0.270.0050.00317.35
8.0.260.0070.00016.89
8.0.250.0070.00016.96
8.0.240.0070.00017.05
8.0.230.0000.00817.07
8.0.220.0000.00816.96
8.0.210.0070.00017.01
8.0.200.0030.00317.09
8.0.190.0060.00317.12
8.0.180.0040.00417.07
8.0.170.0080.00017.02
8.0.160.0070.00016.96
8.0.150.0030.00316.85
8.0.140.0040.00416.94
8.0.130.0030.00313.45
8.0.120.0080.00016.97
8.0.110.0000.00716.93
8.0.100.0040.00416.98
8.0.90.0000.00817.00
8.0.80.0090.00916.91
8.0.70.0070.00016.79
8.0.60.0000.00717.06
8.0.50.0080.00016.86
8.0.30.0150.00816.93
8.0.20.0100.01017.40
8.0.10.0040.00417.00
8.0.00.0120.00916.80
7.4.330.0000.00615.03
7.4.320.0000.00616.65
7.4.300.0000.00616.39
7.4.290.0000.00716.63
7.4.280.0000.00816.56
7.4.270.0030.00316.62
7.4.260.0000.00716.58
7.4.250.0030.00316.52
7.4.240.0010.00616.63
7.4.230.0040.00416.64
7.4.220.0030.01416.56
7.4.210.0100.00716.55
7.4.200.0050.00216.71
7.4.190.0070.00016.68
7.4.160.0060.00916.59
7.4.150.0090.00917.40
7.4.140.0120.00917.86
7.4.130.0100.00716.49
7.4.120.0120.00516.53
7.4.110.0100.00716.33
7.4.100.0140.00616.58
7.4.90.0080.00816.38
7.4.80.0090.00919.39
7.4.70.0070.01016.54
7.4.60.0070.01116.38
7.4.50.0030.00616.44
7.4.40.0090.00622.77
7.4.30.0100.00716.63
7.4.00.0070.01015.05
7.3.330.0060.00013.50
7.3.320.0000.00513.48
7.3.310.0000.00716.46
7.3.300.0000.00716.48
7.3.290.0120.00316.49
7.3.280.0030.01216.50
7.3.270.0120.00917.40
7.3.260.0060.01216.43
7.3.250.0060.01116.58
7.3.240.0110.01216.68
7.3.230.0120.00616.43
7.3.210.0080.00816.46
7.3.200.0120.00619.39
7.3.190.0070.01416.75
7.3.180.0000.01516.50
7.3.170.0080.00816.57
7.3.160.0040.01216.32
7.3.120.0000.01314.80
7.2.330.0040.01416.84
7.2.320.0040.01416.72
7.2.310.0060.01216.64
7.2.300.0060.01116.47
7.2.290.0070.01116.80
7.2.60.0090.00616.84
7.2.00.0000.01419.06
7.1.200.0030.01015.87
7.1.100.0030.01318.14
7.1.70.0080.00317.15
7.1.60.0130.01319.29
7.1.50.0040.01416.99
7.1.00.0000.07722.39
7.0.200.0000.00716.54
7.0.140.0000.07722.01
7.0.60.0070.04019.85
7.0.50.0100.05317.86
7.0.40.0100.08320.14
7.0.30.0300.06720.12
7.0.20.0270.08320.16
7.0.10.0400.07320.08
7.0.00.0030.09020.16
5.6.210.0100.05320.50
5.6.200.0070.03718.25
5.6.190.0130.08020.46
5.6.180.0370.05320.51
5.6.170.0270.08320.53
5.6.160.0030.07320.39
5.6.150.0030.04318.28
5.6.140.0100.06718.23
5.6.130.0130.07718.18
5.6.120.0130.07320.91
5.6.110.0100.03721.11
5.6.100.0100.04021.11
5.6.90.0170.07021.02
5.6.80.0070.07720.41
5.6.70.0200.04020.34
5.5.350.0000.04020.37
5.5.340.0030.07718.04
5.5.330.0100.03720.42
5.5.320.0030.04320.31
5.5.310.0300.07320.42
5.5.300.0070.06317.96
5.5.290.0070.08018.04
5.5.280.0030.05321.00
5.5.270.0070.08720.69
5.5.260.0100.05320.74
5.5.250.0030.04020.68
5.5.240.0070.08320.18
5.4.450.1070.03719.53
5.4.440.0870.07019.61
5.4.430.0800.05319.55
5.4.420.0830.05719.46
5.4.410.1030.05019.17
5.4.400.0800.06019.01
5.4.390.0830.05319.16
5.4.380.0100.05718.61
5.4.370.0200.06018.52
5.4.360.0570.04018.48
5.4.350.0400.07318.80
5.4.340.0230.05718.79
5.4.320.0050.04412.53
5.4.310.0060.03712.52
5.4.300.0060.04012.53
5.4.290.0100.03412.52
5.4.280.0040.03712.39
5.4.270.0050.04212.39
5.4.260.0050.04512.40
5.4.250.0080.03812.40
5.4.240.0060.04412.39
5.4.230.0070.04212.39
5.4.220.0050.03912.39
5.4.210.0050.03712.39
5.4.200.0020.04212.39
5.4.190.0050.03712.38
5.4.180.0110.03212.38
5.4.170.0080.04112.39
5.4.160.0050.03712.39
5.4.150.0080.03412.38
5.4.140.0020.04112.07
5.4.130.0080.04212.06
5.4.120.0070.03512.01
5.4.110.0080.04312.01
5.4.100.0020.04112.01
5.4.90.0030.04612.01
5.4.80.0070.03512.01
5.4.70.0070.03312.01
5.4.60.0030.03712.01
5.4.50.0090.03112.00
5.4.40.0040.03912.00
5.4.30.0080.04611.99
5.4.20.0040.03611.99
5.4.10.0050.03411.99
5.4.00.0020.04211.48
5.3.290.0040.04112.80
5.3.280.0060.03812.71
5.3.270.0060.03812.72
5.3.260.0060.04512.72
5.3.250.0100.03512.72
5.3.240.0040.03812.72
5.3.230.0080.03512.71
5.3.220.0060.03812.68
5.3.210.0060.03912.68
5.3.200.0070.04712.68
5.3.190.0060.03812.67
5.3.180.0030.03812.67
5.3.170.0070.03512.67
5.3.160.0070.03412.67
5.3.150.0070.03512.68
5.3.140.0030.03812.66
5.3.130.0080.03712.66
5.3.120.0050.03912.66
5.3.110.0070.03712.66
5.3.100.0050.03712.12
5.3.90.0040.03812.11
5.3.80.0030.03912.09
5.3.70.0060.03812.09
5.3.60.0060.04012.08
5.3.50.0030.03812.03
5.3.40.0110.03012.03
5.3.30.0060.04711.99
5.3.20.0040.04511.77
5.3.10.0100.05711.73
5.3.00.0070.04511.72
5.2.170.0070.0349.22
5.2.160.0080.0329.22
5.2.150.0010.0379.22
5.2.140.0040.0309.22
5.2.130.0050.0289.18
5.2.120.0090.0249.18
5.2.110.0050.0299.19
5.2.100.0030.0309.18
5.2.90.0020.0339.18
5.2.80.0070.0369.18
5.2.70.0030.0339.18
5.2.60.0050.0309.14
5.2.50.0010.0339.12
5.2.40.0030.0309.09
5.2.30.0060.0299.06
5.2.20.0040.0329.04
5.2.10.0040.0298.96
5.2.00.0020.0328.82
5.1.60.0060.0248.11
5.1.50.0020.0298.11
5.1.40.0050.0238.09
5.1.30.0020.0288.43
5.1.20.7131.750547.91
5.1.10.7771.563687.54
5.1.00.9701.490707.83
5.0.50.0030.0236.64
5.0.40.0060.0256.50
5.0.30.0040.0396.31
5.0.20.0050.0186.28
5.0.10.0030.0216.26
5.0.00.0050.0306.25
4.4.90.0040.0164.78
4.4.80.0010.0194.75
4.4.70.0050.0164.75
4.4.60.0050.0144.75
4.4.50.0020.0174.77
4.4.40.0030.0254.71
4.4.30.0030.0164.76
4.4.20.0060.0144.84
4.4.10.0030.0164.85
4.4.00.0050.0224.76
4.3.110.0020.0174.67
4.3.100.0050.0134.66
4.3.90.0030.0154.63
4.3.80.0010.0264.58
4.3.70.0050.0134.63
4.3.60.0020.0164.63
4.3.50.0030.0154.62
4.3.40.0050.0234.54
4.3.30.0020.0163.28
4.3.20.0030.0153.27
4.3.10.0000.0183.23
4.3.00.0170.01313.14

preferences:
49.77 ms | 401 KiB | 5 Q