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, $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.60.0100.01018.43
8.3.50.0230.01021.93
8.3.40.0120.00318.82
8.3.30.0120.00320.06
8.3.20.0040.00420.34
8.3.10.0080.00022.09
8.3.00.0000.00722.40
8.2.180.0140.00318.29
8.2.170.0040.01122.96
8.2.160.0070.00722.31
8.2.150.0000.00924.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00420.75
8.2.110.0100.01319.30
8.2.100.0090.00317.91
8.2.90.0000.00819.26
8.2.80.0030.00517.97
8.2.70.0080.00017.63
8.2.60.0120.00018.05
8.2.50.0040.00418.07
8.2.40.0070.00418.16
8.2.30.0070.00019.39
8.2.20.0040.00417.64
8.2.10.0040.00417.73
8.2.00.0050.00317.80
8.1.280.0150.00325.92
8.1.270.0050.00323.99
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0000.00822.18
8.1.230.0090.00319.02
8.1.220.0000.00917.74
8.1.210.0030.00518.77
8.1.200.0040.00417.48
8.1.190.0000.00817.63
8.1.180.0000.00818.10
8.1.170.0030.00518.46
8.1.160.0070.00018.95
8.1.150.0080.00018.73
8.1.140.0030.00517.55
8.1.130.0040.00417.83
8.1.120.0000.00817.42
8.1.110.0050.00317.42
8.1.100.0080.00017.53
8.1.90.0000.00717.53
8.1.80.0050.00317.51
8.1.70.0000.00717.40
8.1.60.0030.00617.64
8.1.50.0000.00817.46
8.1.40.0020.00517.59
8.1.30.0000.00817.66
8.1.20.0050.00517.60
8.1.10.0040.00417.53
8.1.00.0100.00017.53
8.0.300.0000.00918.77
8.0.290.0080.00016.88
8.0.280.0070.00018.59
8.0.270.0040.00417.39
8.0.260.0070.00016.93
8.0.250.0030.00317.07
8.0.240.0050.00517.04
8.0.230.0070.00017.06
8.0.220.0040.00416.90
8.0.210.0070.00016.97
8.0.200.0050.00317.13
8.0.190.0060.00317.02
8.0.180.0030.00317.01
8.0.170.0040.00417.03
8.0.160.0080.00017.11
8.0.150.0040.00416.95
8.0.140.0000.00717.01
8.0.130.0000.00613.41
8.0.120.0000.00716.87
8.0.110.0030.00516.99
8.0.100.0000.00717.00
8.0.90.0000.00716.87
8.0.80.0090.00717.07
8.0.70.0040.00416.88
8.0.60.0030.00616.99
8.0.50.0000.00816.88
8.0.30.0120.00717.25
8.0.20.0050.01217.40
8.0.10.0040.00417.05
8.0.00.0120.00916.76
7.4.330.0000.00615.00
7.4.320.0030.00316.61
7.4.300.0030.00316.55
7.4.290.0000.00716.65
7.4.280.0050.00316.57
7.4.270.0030.00716.61
7.4.260.0000.00513.22
7.4.250.0040.00416.41
7.4.240.0030.00316.55
7.4.230.0040.00416.76
7.4.220.0090.00916.76
7.4.210.0060.00816.57
7.4.200.0040.00416.65
7.4.190.0000.00716.71
7.4.160.0090.00916.72
7.4.150.0180.00017.40
7.4.140.0070.01217.86
7.4.130.0090.00916.45
7.4.120.0120.00716.57
7.4.110.0100.01016.64
7.4.100.0100.01016.63
7.4.90.0090.00916.62
7.4.80.0090.01119.39
7.4.70.0080.00816.57
7.4.60.0130.00916.66
7.4.50.0060.00316.53
7.4.40.0060.01222.77
7.4.30.0130.00316.52
7.4.10.0100.01015.09
7.4.00.0050.01015.08
7.3.330.0000.00513.47
7.3.320.0030.00613.26
7.3.310.0040.00416.50
7.3.300.0070.00016.34
7.3.290.0030.01216.46
7.3.280.0080.00716.46
7.3.270.0100.00717.40
7.3.260.0170.00316.70
7.3.250.0170.00116.47
7.3.240.0190.00016.38
7.3.230.0080.00816.39
7.3.210.0070.01016.47
7.3.200.0120.00919.39
7.3.190.0030.01416.58
7.3.180.0160.00316.71
7.3.170.0060.01016.36
7.3.160.0100.00716.59
7.3.130.0060.01314.91
7.3.120.0090.00814.92
7.3.110.0070.01014.91
7.3.100.0050.00915.05
7.3.90.0060.00714.91
7.3.80.0020.00714.73
7.3.70.0030.00614.90
7.3.60.0020.00914.90
7.3.50.0030.00914.89
7.3.40.0010.01214.68
7.3.30.0030.01214.67
7.3.20.0030.00816.70
7.3.10.0060.00816.64
7.3.00.0020.01316.62
7.2.330.0150.00316.56
7.2.320.0060.01616.82
7.2.310.0100.00716.85
7.2.300.0080.00816.86
7.2.290.0090.01216.81
7.2.260.0130.00715.29
7.2.250.0130.00615.09
7.2.240.0050.01215.10
7.2.230.0080.00614.94
7.2.220.0020.01015.12
7.2.210.0020.01114.95
7.2.200.0100.00215.02
7.2.190.0050.01014.93
7.2.180.0040.00715.04
7.2.170.0080.00615.01
7.2.160.0080.00315.18
7.2.150.0030.00716.97
7.2.140.0040.01116.99
7.2.130.0030.01216.93
7.2.120.0060.01016.98
7.2.110.0070.00616.96
7.2.100.0100.00516.99
7.2.90.0050.00616.78
7.2.80.0030.01017.07
7.2.70.0070.00717.04
7.2.60.0090.00517.03
7.2.50.0080.00416.88
7.2.40.0070.00516.92
7.2.30.0060.00716.96
7.2.20.0090.00817.06
7.2.10.0050.00916.94
7.2.00.0030.01017.58
7.1.330.0040.00815.87
7.1.320.0060.00915.84
7.1.310.0070.00615.88
7.1.300.0080.00515.82
7.1.290.0050.00615.82
7.1.280.0070.00515.89
7.1.270.0060.00515.78
7.1.260.0120.00315.63
7.1.250.0020.01115.80
7.1.240.0150.00015.88
7.1.230.0060.00915.89
7.1.220.0000.01515.88
7.1.210.0040.00415.85
7.1.200.0000.00915.91
7.1.190.0060.00615.91
7.1.180.0070.00715.79
7.1.170.0040.00415.88
7.1.160.0030.01015.92
7.1.150.0030.01015.63
7.1.140.0080.00315.76
7.1.130.0060.00615.88
7.1.120.0080.00415.97
7.1.110.0070.00715.86
7.1.100.0020.01017.14
7.1.90.0100.00315.71
7.1.80.0000.01415.91
7.1.70.0050.00816.48
7.1.60.0060.01417.49
7.1.50.0110.00825.13
7.1.40.0060.00315.69
7.1.30.0040.00715.84
7.1.20.0000.01215.75
7.1.10.0070.00715.50
7.1.00.0050.03819.10
7.0.330.0000.01315.26
7.0.320.0070.00715.37
7.0.310.0040.01115.52
7.0.300.0060.00615.50
7.0.290.0040.01115.43
7.0.280.0030.01315.46
7.0.270.0100.00315.32
7.0.260.0030.00915.27
7.0.250.0040.00815.53
7.0.240.0000.01015.46
7.0.230.0040.00715.59
7.0.220.0000.01115.50
7.0.210.0000.00815.45
7.0.200.0080.00915.09
7.0.190.0050.00515.53
7.0.180.0030.00915.57
7.0.170.0030.01015.36
7.0.160.0110.00415.46
7.0.150.0060.00915.55
7.0.140.0090.03718.81
7.0.130.0080.00615.19
7.0.120.0100.00315.46
7.0.110.0150.00015.34
7.0.100.0080.03817.81
7.0.90.0060.04217.75
7.0.80.0220.03817.62
7.0.70.0100.03617.79
7.0.60.0170.04317.53
7.0.50.0030.02818.00
7.0.40.0110.02816.73
7.0.30.0070.04616.84
7.0.20.0060.03616.84
7.0.10.0070.04016.73
7.0.00.0110.02816.66
5.6.400.0070.01014.13
5.6.390.0110.00414.60
5.6.380.0110.00414.55
5.6.370.0030.01314.59
5.6.360.0060.00914.52
5.6.350.0080.00314.45
5.6.340.0030.01314.38
5.6.330.0070.00714.33
5.6.320.0110.00414.73
5.6.310.0070.00714.36
5.6.300.0110.00314.66
5.6.290.0060.01014.20
5.6.280.0060.04017.71
5.6.270.0060.01014.45
5.6.260.0070.01014.51
5.6.250.0020.04817.54
5.6.240.0150.03217.60
5.6.230.0090.04217.43
5.6.220.0000.04617.58
5.6.210.0050.04517.64
5.6.200.0070.04417.76
5.6.190.0050.03017.69
5.6.180.0050.04517.66
5.6.170.0120.02317.72
5.6.160.0090.04517.85
5.6.150.0140.03217.64
5.6.140.0140.04017.86
5.6.130.0020.04617.69
5.6.120.0090.03517.76
5.6.110.0070.04517.71
5.6.100.0070.04317.65
5.6.90.0100.04217.72
5.6.80.0100.04217.55
5.6.70.0070.02317.59
5.6.60.0110.02317.47
5.6.50.0080.03317.38
5.6.40.0080.03517.42
5.6.30.0030.04117.34
5.6.20.0110.03117.37
5.6.10.0100.04017.46
5.6.00.0050.04317.28
5.5.380.0050.04517.29
5.5.370.0070.04117.26
5.5.360.0090.02917.45
5.5.350.0100.02717.46
5.5.340.0050.04717.52
5.5.330.0030.04417.63
5.5.320.0050.04517.65
5.5.310.0080.03317.66
5.5.300.0120.04017.64
5.5.290.0080.04417.57
5.5.280.0020.05217.68
5.5.270.0020.02617.46
5.5.260.0070.04217.63
5.5.250.0090.02017.45
5.5.240.0090.04017.42
5.5.230.0070.03717.32
5.5.220.0070.04017.30
5.5.210.0050.04217.27
5.5.200.0070.04717.23
5.5.190.0030.05217.43
5.5.180.0060.02317.12
5.5.170.0030.01014.31
5.5.160.0070.02217.26
5.5.150.0050.03817.20
5.5.140.0080.04117.34
5.5.130.0050.02617.28
5.5.120.0050.04317.39
5.5.110.0080.02517.35
5.5.100.0080.04017.35
5.5.90.0070.04317.20
5.5.80.0080.03317.17
5.5.70.0090.04217.22
5.5.60.0080.03717.26
5.5.50.0100.04117.29
5.5.40.0080.02617.22
5.5.30.0110.03317.28
5.5.20.0120.03117.26
5.5.10.0030.04217.18
5.5.00.0050.04017.13
5.4.450.0030.04115.37
5.4.440.0050.02815.32
5.4.430.0090.03715.24
5.4.420.0020.03715.20
5.4.410.0020.02515.33
5.4.400.0030.04214.94
5.4.390.0070.03515.05
5.4.380.0030.02314.98
5.4.370.0030.04215.11
5.4.360.0070.02315.01
5.4.350.0020.02515.19
5.4.340.0110.03715.12
5.4.330.0000.01310.88
5.4.320.0040.04015.16
5.4.310.0030.03815.13
5.4.300.0030.02915.15
5.4.290.0030.03015.06
5.4.280.0070.04015.22
5.4.270.0070.02815.22
5.4.260.0080.03615.13
5.4.250.0100.03714.84
5.4.240.0050.02014.94
5.4.230.0020.03415.19
5.4.220.0080.03915.00
5.4.210.0060.02015.08
5.4.200.0020.02515.22
5.4.190.0140.03315.06
5.4.180.0030.03715.16
5.4.170.0030.01815.01
5.4.160.0020.04215.11
5.4.150.0050.04314.88
5.4.140.0050.03013.83
5.4.130.0020.04313.85
5.4.120.0070.02313.75
5.4.110.0020.02813.78
5.4.100.0080.03313.79
5.4.90.0090.03713.92
5.4.80.0030.02613.84
5.4.70.0110.03513.80
5.4.60.0100.03213.78
5.4.50.0050.01913.75
5.4.40.0050.02213.81
5.4.30.0050.04113.67
5.4.20.0060.02613.71
5.4.10.0020.03913.78
5.4.00.0060.03813.51
5.3.290.0030.03712.83
5.3.280.0000.02712.76
5.3.270.0070.03012.72
5.3.260.0020.04712.71
5.3.250.0070.02512.72
5.3.240.0030.03612.73
5.3.230.0070.04312.76
5.3.220.0070.03312.74
5.3.210.0080.04212.78
5.3.200.0050.03912.72
5.3.190.0030.04112.71
5.3.180.0070.03812.74
5.3.170.0030.03512.73
5.3.160.0070.03712.70
5.3.150.0080.03212.77
5.3.140.0020.04112.72
5.3.130.0100.03912.76
5.3.120.0010.04312.71
5.3.110.0060.03012.69
5.3.100.0050.04012.46
5.3.90.0040.02112.49
5.3.80.0090.02212.43
5.3.70.0020.04312.40
5.3.60.0030.03312.43
5.3.50.0130.03112.43
5.3.40.0020.03012.43
5.3.30.0070.03712.41
5.3.20.0050.03012.23
5.3.10.0050.03012.26
5.3.00.0030.02912.32
5.2.170.0030.03711.74
5.2.160.0070.06311.74
5.2.150.0000.06011.74
5.2.140.0070.05711.74
5.2.130.0100.05011.74
5.2.120.0100.03311.74
5.2.110.0000.04311.74
5.2.100.0070.03011.74
5.2.90.0030.02711.74
5.2.80.0000.03311.74
5.2.70.0030.03011.74
5.2.60.0030.02711.74
5.2.50.0030.03011.74
5.2.40.0070.02711.74
5.2.30.0070.02711.74
5.2.20.0030.02711.74
5.2.10.0000.03011.74
5.2.00.0000.03011.74
5.1.60.0030.02311.74
5.1.50.0030.02311.74
5.1.40.0030.02311.74
5.1.30.0070.02311.74
5.1.20.0000.02711.74
5.1.10.0000.02711.74
5.1.00.0030.02311.74
5.0.50.0030.02311.74
5.0.40.0000.02011.74
5.0.30.0000.03011.74
5.0.20.0070.02011.74
5.0.10.0000.02011.74
5.0.00.0000.03011.74
4.4.90.0000.01711.74
4.4.80.0000.02011.74
4.4.70.0000.01711.74
4.4.60.0000.01711.74
4.4.50.0030.01011.74
4.4.40.0070.01711.74
4.4.30.0030.01711.74
4.4.20.0000.01711.74
4.4.10.0000.01711.74
4.4.00.0000.02311.74
4.3.110.0070.01011.74
4.3.100.0000.02311.74
4.3.90.0000.01711.74
4.3.80.0000.03311.74
4.3.70.0030.03011.74
4.3.60.0030.03011.74
4.3.50.0000.03711.74
4.3.40.0070.01711.74
4.3.30.0000.01711.74
4.3.20.0000.02311.74
4.3.10.0000.03311.74
4.3.00.0030.03011.74

preferences:
49.84 ms | 401 KiB | 5 Q