3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StreamFilter extends php_user_filter { public function filter($in, $out, &$consumed, $closing) { //var_dump('FILTERING!'); while ($bucket = stream_bucket_make_writeable($in)) ; if ($closing || feof($this->stream)) { $streamUri = substr(stream_get_meta_data($this->stream)['uri'], strlen('php://filter/read=asd/resource=')); //$buffer = strtoupper(file_get_contents($streamUri)); $buffer = 'HA'; $bucket = stream_bucket_new($this->stream, $buffer); stream_bucket_append($out, $bucket); return PSFS_PASS_ON; } return PSFS_FEED_ME; } } stream_filter_register('asd', 'StreamFilter'); function shut() { $stream = 'php://filter/read=asd/resource=/home/vagrant/test-register-shutdown-function/test.txt'; $stream = 'php://filter/read=asd/resource=/in/Yjm5O'; var_dump(file_get_contents($stream)); //$stream = 'php://filter/read=string.toupper/resource=/home/vagrant/test-register-shutdown-function/test.txt'; //var_dump(file_get_contents($stream)); } register_shutdown_function('shut'); /* class A { public function __destruct() { } } new A(); */ die;

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.00718.30
8.3.50.0110.00822.03
8.3.40.0120.00918.79
8.3.30.0060.00918.79
8.3.20.0070.00020.23
8.3.10.0060.00320.45
8.3.00.0050.00323.66
8.2.180.0210.00017.00
8.2.170.0140.00322.96
8.2.160.0110.00422.27
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00320.92
8.2.120.0080.00026.35
8.2.110.0030.00622.13
8.2.100.0090.00317.93
8.2.90.0040.00419.22
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0100.00218.09
8.2.40.0040.00422.12
8.2.30.0030.00319.29
8.2.20.0080.00017.69
8.2.10.0040.00417.98
8.2.00.0070.00018.02
8.1.280.0090.00625.92
8.1.270.0080.00021.92
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.05
8.1.230.0100.00019.01
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0040.00418.46
8.1.160.0000.00720.76
8.1.150.0050.00318.87
8.1.140.0040.00419.56
8.1.130.0030.00317.69
8.1.120.0070.00017.42
8.1.110.0000.00717.34
8.1.100.0040.00417.34
8.1.90.0040.00417.35
8.1.80.0000.00717.51
8.1.70.0000.00817.45
8.1.60.0000.00817.61
8.1.50.0040.00417.56
8.1.40.0030.00617.48
8.1.30.0060.00317.70
8.1.20.0060.00317.60
8.1.10.0000.00817.62
8.1.00.0040.00417.44
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.49
8.0.270.0040.00417.27
8.0.260.0040.00417.31
8.0.250.0040.00417.08
8.0.240.0000.00716.92
8.0.230.0070.00016.93
8.0.220.0070.00016.95
8.0.210.0000.00716.95
8.0.200.0030.00317.02
8.0.190.0000.00816.95
8.0.180.0070.00017.05
8.0.170.0030.00617.05
8.0.160.0040.00316.96
8.0.150.0090.00016.84
8.0.140.0030.00516.84
8.0.130.0030.00313.42
8.0.120.0000.00916.89
8.0.110.0000.00716.91
8.0.100.0000.00717.00
8.0.90.0000.00716.89
8.0.80.0000.02216.91
8.0.70.0050.00217.03
8.0.60.0030.00516.95
8.0.50.0000.00717.11
8.0.30.0030.01317.02
8.0.20.0090.01117.40
8.0.10.0040.00416.86
8.0.00.0100.01016.84
7.4.330.0050.00016.77
7.4.320.0040.00416.59
7.4.300.0000.00616.61
7.4.290.0000.00816.54
7.4.280.0080.00016.57
7.4.270.0080.00016.51
7.4.260.0080.00016.48
7.4.250.0040.00416.38
7.4.240.0040.00416.59
7.4.230.0000.00716.40
7.4.220.0140.01016.59
7.4.210.0100.00516.44
7.4.200.0070.00016.68
7.4.160.0120.00416.66
7.4.150.0130.01017.40
7.4.140.0180.00317.86
7.4.130.0100.01016.46
7.4.120.0070.01016.42
7.4.110.0100.00716.68
7.4.100.0070.01116.60
7.4.90.0040.01416.50
7.4.80.0070.01719.39
7.4.70.0140.00316.51
7.4.60.0150.01116.52
7.4.50.0110.00316.41
7.4.40.0130.01016.36
7.4.30.0030.01616.56
7.4.00.0070.01014.86
7.3.330.0030.00313.13
7.3.320.0000.00613.18
7.3.310.0000.00716.37
7.3.300.0070.00016.36
7.3.290.0070.00016.21
7.3.280.0110.00816.36
7.3.270.0090.00917.40
7.3.260.0100.00716.34
7.3.250.0090.00816.28
7.3.240.0070.01016.29
7.3.230.0090.00916.39
7.3.210.0080.00816.45
7.3.200.0070.01019.39
7.3.190.0110.00716.33
7.3.180.0100.00616.27
7.3.170.0040.01416.35
7.3.160.0030.01316.34
7.3.10.0100.00716.35
7.3.00.0140.00016.71
7.2.330.0090.00916.42
7.2.320.0080.00816.54
7.2.310.0100.00716.64
7.2.300.0170.00716.54
7.2.290.0140.00716.65
7.2.130.0030.01016.76
7.2.120.0030.00916.59
7.2.110.0070.00716.72
7.2.100.0110.00016.82
7.2.90.0060.00916.54
7.2.80.0110.00416.77
7.2.70.0060.00916.55
7.2.60.0040.00916.82
7.2.50.0040.01216.67
7.2.40.0130.00016.92
7.2.30.0070.00716.96
7.2.20.0060.00616.84
7.2.10.0120.00316.81
7.2.00.0050.00718.06
7.1.250.0030.01015.74
7.1.200.0060.01115.45
7.1.100.0000.01118.20
7.1.70.0070.01017.07
7.1.60.0070.01019.40
7.1.50.0120.01934.29
7.1.00.0000.08022.33
7.0.200.0280.00714.77
7.0.60.0300.07321.88
7.0.50.0070.05317.86
7.0.40.0070.09320.08
7.0.30.0230.04020.21
7.0.20.0300.08020.21
7.0.10.0130.04020.09
7.0.00.0130.07720.22
5.6.280.0030.05020.87
5.6.210.0130.04720.52
5.6.200.0100.03318.12
5.6.190.0030.05720.63
5.6.180.0270.04720.61
5.6.170.0170.04320.51
5.6.160.0100.08320.62
5.6.150.0070.08018.17
5.6.140.0100.05018.18
5.6.130.0100.07318.16
5.6.120.0070.04021.06
5.6.110.0130.06721.00
5.6.100.0000.04720.99
5.6.90.0030.04020.99
5.6.80.0070.08020.40
5.5.350.0230.07320.31
5.5.340.0170.07318.09
5.5.330.0030.08020.41
5.5.320.0170.04020.27
5.5.310.0200.08720.36
5.5.300.0070.07717.97
5.5.290.0070.05017.96
5.5.280.0000.04320.91
5.5.270.0000.09320.87
5.5.260.0070.07720.73
5.5.250.0130.06320.80
5.5.240.0270.07320.36

preferences:
51.43 ms | 401 KiB | 5 Q