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(); register_shutdown_function(function () { echo file_get_contents('php://filter/read=go.source.transforming.loader/resource=' . __FILE__); });

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.0070.00718.66
8.3.30.0070.00720.38
8.3.20.0040.00420.34
8.3.10.0040.00422.13
8.3.00.0080.00022.40
8.2.170.0150.00622.96
8.2.160.0030.01020.52
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0060.00326.16
8.2.120.0050.00220.87
8.2.110.0090.00020.94
8.2.100.0060.00618.03
8.2.90.0030.00519.21
8.2.80.0080.00317.97
8.2.70.0000.01017.63
8.2.60.0050.00317.93
8.2.50.0090.00018.10
8.2.40.0060.00618.28
8.2.30.0070.00319.54
8.2.20.0000.00817.64
8.2.10.0080.00017.67
8.2.00.0000.00717.77
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00022.66
8.1.230.0080.00417.83
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0070.00317.35
8.1.190.0030.00617.13
8.1.180.0080.00018.10
8.1.170.0030.00518.57
8.1.160.0080.00018.95
8.1.150.0000.00818.62
8.1.140.0000.00817.53
8.1.130.0070.00017.88
8.1.120.0040.00417.57
8.1.110.0000.00717.50
8.1.100.0040.00417.41
8.1.90.0030.00617.51
8.1.80.0000.00717.51
8.1.70.0000.00817.53
8.1.60.0000.00917.50
8.1.50.0000.00717.56
8.1.40.0030.00517.45
8.1.30.0040.00417.67
8.1.20.0030.00617.66
8.1.10.0080.00017.65
8.1.00.0050.00317.44
8.0.300.0070.00018.77
8.0.290.0030.00517.00
8.0.280.0030.00318.54
8.0.270.0070.00017.40
8.0.260.0030.00316.80
8.0.250.0030.00317.13
8.0.240.0060.00617.10
8.0.230.0050.00216.95
8.0.220.0030.00316.99
8.0.210.0030.00316.96
8.0.200.0000.00617.04
8.0.190.0040.00417.05
8.0.180.0000.00816.92
8.0.170.0000.00816.95
8.0.160.0050.00316.84
8.0.150.0000.00816.93
8.0.140.0000.00717.02
8.0.130.0030.00313.43
8.0.120.0000.00816.98
8.0.110.0040.00416.97
8.0.100.0040.00416.90
8.0.90.0030.00517.00
8.0.80.0070.00716.93
8.0.70.0040.00417.07
8.0.60.0040.00416.87
8.0.50.0040.00417.04
8.0.30.0060.01317.15
8.0.20.0090.01017.40
8.0.10.0050.00216.89
8.0.00.0050.01316.88
7.4.330.0030.00315.07
7.4.320.0030.00316.56
7.4.300.0000.00716.54
7.4.290.0000.00616.48
7.4.280.0040.00416.52
7.4.270.0090.00016.52
7.4.260.0000.00513.16
7.4.250.0000.01016.67
7.4.240.0030.00516.56
7.4.230.0000.00816.50
7.4.220.0160.01016.59
7.4.210.0080.00716.69
7.4.200.0040.00416.43
7.4.190.0000.00716.80
7.4.160.0080.01116.50
7.4.150.0130.00717.40
7.4.140.0130.00517.86
7.4.130.0090.00816.61
7.4.120.0060.01116.60
7.4.110.0130.00616.48
7.4.100.0070.01316.48
7.4.90.0130.00416.57
7.4.80.0090.01219.39
7.4.70.0030.01516.64
7.4.60.0070.01116.55
7.4.50.0070.00016.24
7.4.40.0070.01122.77
7.4.30.0060.01216.46
7.4.00.0100.00714.89
7.3.330.0050.00013.53
7.3.320.0000.00513.32
7.3.310.0000.00816.50
7.3.300.0000.00716.45
7.3.290.0110.00316.45
7.3.280.0100.00616.44
7.3.270.0140.00617.40
7.3.260.0130.00716.77
7.3.250.0110.01116.46
7.3.240.0070.01016.66
7.3.230.0130.00316.66
7.3.210.0060.01316.60
7.3.200.0140.00819.39
7.3.190.0090.01416.59
7.3.180.0130.00316.67
7.3.170.0100.01016.53
7.3.160.0090.00616.34
7.3.120.0070.01014.98
7.3.110.0070.00915.06
7.3.100.0100.00314.61
7.3.90.0080.00914.94
7.3.80.0060.00814.94
7.3.70.0020.00814.99
7.3.60.0080.01114.85
7.3.50.0050.01314.89
7.3.40.0030.00814.94
7.3.30.0050.01014.98
7.3.20.0050.00816.66
7.3.10.0100.00316.72
7.3.00.0070.00616.76
7.2.330.0060.01216.77
7.2.320.0150.00316.77
7.2.310.0060.01216.58
7.2.300.0060.01016.76
7.2.290.0060.01016.78
7.2.250.0050.01415.02
7.2.240.0060.01214.98
7.2.230.0100.00515.19
7.2.220.0040.00815.31
7.2.210.0050.01115.06
7.2.200.0050.00714.99
7.2.190.0090.00815.00
7.2.180.0050.00915.15
7.2.170.0080.00715.02
7.2.00.0080.01219.35
7.1.330.0070.00915.78
7.1.320.0050.00715.67
7.1.310.0080.00515.96
7.1.300.0070.00915.68
7.1.290.0070.01015.86
7.1.280.0060.00515.53
7.1.270.0090.00415.64
7.1.260.0020.01215.77
7.1.100.0140.01415.97
7.1.70.0000.00917.19
7.1.60.0140.01119.32
7.1.50.0040.01517.04
7.1.00.0030.07022.27
7.0.200.0210.00716.17
7.0.140.0070.06721.97
7.0.110.0100.05719.88
7.0.100.0170.07020.07
7.0.90.0070.08719.96
7.0.80.0130.04720.05
7.0.70.0130.08019.99
7.0.60.0070.08020.02
7.0.50.0100.08319.97
7.0.40.0200.06319.79
7.0.30.0030.09019.66
7.0.20.0100.03719.84
7.0.10.0070.04019.82
7.0.00.0030.04319.65
5.6.280.0030.07320.82
5.6.260.0030.07720.70
5.6.250.0030.08320.66
5.6.240.0100.08020.71
5.6.230.0170.07720.67
5.6.220.0170.06720.69
5.6.210.0030.08720.73
5.6.200.0030.07020.58
5.6.190.0100.07720.63
5.6.180.0100.07320.62
5.6.170.0070.08320.86
5.6.160.0100.04020.60
5.6.150.0100.03720.66
5.6.140.0100.03720.63
5.6.130.0000.06720.66
5.6.120.0070.04020.63
5.6.110.0070.04020.61
5.6.100.0070.04320.46
5.6.90.0070.08320.58
5.6.80.0070.03720.05
5.6.70.0100.06720.04
5.6.60.0100.07319.93
5.6.50.0030.03720.25
5.6.40.0000.06019.93
5.6.30.0130.07019.98
5.6.20.0100.03320.04
5.6.10.0030.04720.22
5.6.00.0100.03020.21
5.5.380.0030.07717.52
5.5.370.0070.08017.52
5.5.360.0000.09017.50
5.5.350.0070.08017.62
5.5.340.0130.07018.10
5.5.330.0130.07317.92
5.5.320.0100.08018.10
5.5.310.0030.07318.13
5.5.300.0030.04717.91
5.5.290.0100.03318.22
5.5.280.0000.04718.07
5.5.270.0070.04017.95
5.5.260.0000.04718.08
5.5.250.0070.03717.92
5.5.240.0030.04717.30
5.5.230.0100.05017.29
5.5.220.0030.03717.33
5.5.210.0030.04717.51
5.5.200.0100.03317.27
5.5.190.0030.03717.45
5.5.180.0000.04317.45
5.5.160.0000.04317.44
5.5.150.0100.05317.28
5.5.140.0000.08717.28
5.5.130.0070.03317.28
5.5.120.0000.04017.28
5.5.110.0030.04317.59
5.5.100.0030.06017.51
5.5.90.0030.03717.34
5.5.80.0000.04317.18
5.5.70.0000.04017.29
5.5.60.0070.06317.29
5.5.50.0070.04317.06
5.5.40.0070.04717.34
5.5.30.0000.04717.49
5.5.20.0000.04717.34
5.5.10.0070.07317.15
5.5.00.0070.07717.16
5.4.450.0130.07319.32
5.4.440.0030.04019.32
5.4.430.0030.08019.56
5.4.420.0030.04019.41
5.4.410.0070.03719.20
5.4.400.0030.03719.00
5.4.390.0070.03319.01
5.4.380.0070.05019.02
5.4.370.0070.04319.00
5.4.360.0030.05319.14
5.4.350.0000.04718.99
5.4.340.0070.04019.34
5.4.320.0030.06019.03
5.4.310.0000.04019.09
5.4.300.0000.05019.19
5.4.290.0000.04019.18
5.4.280.0070.04719.31
5.4.270.0030.03718.95
5.4.260.0070.03719.01
5.4.250.0030.04019.33
5.4.240.0000.03719.01
5.4.230.0130.05019.23
5.4.220.0070.03719.30
5.4.210.0070.06019.00
5.4.200.0070.03019.17
5.4.190.0030.07019.17
5.4.180.0000.05319.30
5.4.170.0030.03319.13
5.4.160.0130.07718.98
5.4.150.0070.08018.98
5.4.140.0000.06016.52
5.4.130.0130.06316.62
5.4.120.0070.07716.61
5.4.110.0070.08016.61
5.4.100.0030.07316.31
5.4.90.0070.06716.63
5.4.80.0100.07316.59
5.4.70.0130.05716.46
5.4.60.0100.07016.42
5.4.50.0030.06016.41
5.4.40.0070.07716.49
5.4.30.0100.07016.57
5.4.20.0100.07016.53
5.4.10.0070.07316.33
5.4.00.0130.06715.95
5.3.290.0070.03014.75
5.3.280.0030.03714.59
5.3.270.0030.05314.62
5.3.260.0100.07014.49
5.3.250.0070.07014.73
5.3.240.0030.06714.49
5.3.230.0170.06714.64
5.3.220.0070.07314.58
5.3.210.0130.07014.57
5.3.200.0000.07714.73
5.3.190.0100.07014.59
5.3.180.0030.07314.73
5.3.170.0130.06714.71
5.3.160.0070.07714.57
5.3.150.0030.08014.63
5.3.140.0100.06714.58
5.3.130.0070.07714.54
5.3.120.0170.06014.80
5.3.110.0070.07314.58
5.3.100.0170.06314.14
5.3.90.0130.04014.07
5.3.80.0130.06314.10
5.3.70.0100.07014.00
5.3.60.0100.05314.04
5.3.50.0100.06714.04
5.3.40.0130.07013.98
5.3.30.0070.07313.97
5.3.20.0130.07313.71
5.3.10.0130.06313.63
5.3.00.0000.07713.70
5.2.170.0030.05711.28
5.2.160.0030.06011.23
5.2.150.0070.06011.23
5.2.140.0030.06311.21
5.2.130.0030.06311.23
5.2.120.0100.04311.18
5.2.110.0070.06011.08
5.2.100.0070.06311.10
5.2.90.0030.06311.10
5.2.80.0130.05311.25
5.2.70.0100.04311.11
5.2.60.0030.06011.05
5.2.50.0070.06311.04
5.2.40.0000.06711.13
5.2.30.0030.06010.99
5.2.20.0070.05310.96
5.2.10.0000.05710.87
5.2.00.0030.06310.71
5.1.60.0070.05310.19
5.1.50.0000.05710.19
5.1.40.0070.06010.19
5.1.30.0030.05310.58
5.1.20.0030.05710.49
5.1.10.0100.05010.19
5.1.00.0030.05710.19
5.0.50.0070.03710.19
5.0.40.0070.04010.19
5.0.30.0000.07010.19
5.0.20.0000.04710.19
5.0.10.0030.04310.19
5.0.00.0030.06310.19
4.4.90.0000.02010.19
4.4.80.0000.02010.19
4.4.70.0000.03710.19
4.4.60.0100.02710.19
4.4.50.0000.03710.19
4.4.40.0070.03310.19
4.4.30.0000.03710.19
4.4.20.0000.03710.19
4.4.10.0070.03010.19
4.4.00.0030.05010.19
4.3.110.0000.03710.19
4.3.100.0100.02010.19
4.3.90.0000.02310.19
4.3.80.0000.04710.19
4.3.70.0000.03010.19
4.3.60.0030.03010.19
4.3.50.0030.03310.19
4.3.40.0070.04310.19
4.3.30.0000.02710.19
4.3.20.0030.03310.19
4.3.10.0000.03710.19
4.3.00.0000.03310.19

preferences:
42.03 ms | 400 KiB | 5 Q