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.40.0070.00718.79
8.3.30.0110.00418.79
8.3.20.0030.00520.20
8.3.10.0000.00820.59
8.3.00.0050.00323.57
8.2.170.0120.00622.96
8.2.160.0060.00922.14
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.87
8.2.120.0070.00026.35
8.2.110.0060.00320.48
8.2.100.0040.00719.45
8.2.90.0000.00817.50
8.2.80.0050.00318.78
8.2.70.0030.00617.50
8.2.60.0000.00817.63
8.2.50.0030.00517.68
8.2.40.0080.00019.52
8.2.30.0020.00519.34
8.2.20.0040.00417.81
8.2.10.0040.00418.13
8.2.00.0040.00418.02
8.1.270.0050.00522.19
8.1.260.0000.00828.09
8.1.250.0000.00828.09
8.1.240.0040.00423.96
8.1.230.0060.00619.16
8.1.220.0060.00318.59
8.1.210.0040.00418.77
8.1.200.0090.00017.23
8.1.190.0050.00317.13
8.1.180.0040.00418.10
8.1.170.0050.00317.62
8.1.160.0000.00720.69
8.1.150.0080.00018.92
8.1.140.0040.00419.59
8.1.130.0000.00717.67
8.1.120.0040.00417.47
8.1.110.0000.00717.33
8.1.100.0030.00517.43
8.1.90.0000.00717.46
8.1.80.0000.00717.47
8.1.70.0040.00417.34
8.1.60.0050.00317.54
8.1.50.0060.00317.44
8.1.40.0040.00417.45
8.1.30.0040.00417.59
8.1.20.0040.00417.59
8.1.10.0000.00717.63
8.1.00.0000.00817.47
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0060.00318.52
8.0.270.0030.00317.15
8.0.260.0060.00017.34
8.0.250.0000.00817.07
8.0.240.0070.00017.02
8.0.230.0030.00317.09
8.0.220.0030.00616.89
8.0.210.0000.00716.97
8.0.200.0030.00317.04
8.0.190.0000.00817.12
8.0.180.0070.00017.08
8.0.170.0030.00616.97
8.0.160.0040.00416.86
8.0.150.0040.00416.93
8.0.140.0040.00416.95
8.0.130.0000.00713.41
8.0.120.0090.00016.92
8.0.110.0070.00016.90
8.0.100.0000.00716.91
8.0.90.0000.00716.98
8.0.80.0070.01017.05
8.0.70.0000.00716.80
8.0.60.0050.00316.90
8.0.50.0040.00416.89
8.0.30.0090.00817.13
8.0.20.0080.01017.40
8.0.10.0040.00416.97
8.0.00.0090.00916.72
7.4.330.0050.00016.67
7.4.320.0000.00616.39
7.4.300.0000.00616.50
7.4.290.0040.00416.50
7.4.280.0000.00816.57
7.4.270.0060.00316.47
7.4.260.0000.00816.53
7.4.250.0080.00016.46
7.4.240.0000.00816.52
7.4.230.0070.00016.32
7.4.220.0140.01016.43
7.4.210.0100.00716.65
7.4.200.0000.00716.67
7.4.160.0080.00816.80
7.4.150.0110.00617.40
7.4.140.0130.00617.86
7.4.130.0110.01016.35
7.4.120.0080.00916.53
7.4.110.0160.01016.56
7.4.100.0030.01816.63
7.4.90.0080.01616.39
7.4.80.0070.01019.39
7.4.70.0070.01016.49
7.4.60.0160.00916.51
7.4.50.0030.00816.29
7.4.40.0120.00616.50
7.4.30.0070.01116.73
7.4.10.0070.01114.62
7.4.00.0090.00815.01
7.3.330.0030.00313.30
7.3.320.0000.00513.35
7.3.310.0080.00016.38
7.3.300.0000.00716.23
7.3.290.0030.00316.30
7.3.280.0110.01016.36
7.3.270.0090.00917.40
7.3.260.0110.00616.48
7.3.250.0090.00916.41
7.3.240.0120.00516.31
7.3.230.0140.00916.47
7.3.210.0120.00616.29
7.3.200.0120.00619.39
7.3.190.0000.01616.57
7.3.180.0090.00616.30
7.3.170.0030.01616.34
7.3.160.0110.00516.59
7.3.130.0060.01214.74
7.3.120.0110.00414.59
7.3.110.0030.01214.74
7.3.100.0040.01114.58
7.3.90.0090.00614.95
7.3.80.0090.00014.81
7.3.70.0030.01614.84
7.3.60.0040.01514.57
7.3.50.0030.00914.87
7.3.40.0090.00014.81
7.3.30.0000.00814.54
7.3.20.0060.00316.55
7.3.10.0030.01016.36
7.3.00.0070.01016.61
7.2.330.0090.00916.63
7.2.320.0100.00716.73
7.2.310.0180.00316.36
7.2.300.0030.01916.57
7.2.290.0070.01016.45
7.2.260.0030.01614.85
7.2.250.0030.01514.68
7.2.240.0170.00014.76
7.2.230.0110.00314.71
7.2.220.0030.00715.22
7.2.210.0030.01614.84
7.2.200.0070.01114.92
7.2.190.0030.00614.58
7.2.180.0030.01015.05
7.2.170.0090.00015.09
7.2.160.0000.00914.59
7.2.150.0000.01216.55
7.2.140.0080.00816.72
7.2.130.0120.00616.87
7.2.120.0070.00716.84
7.2.110.0080.00416.76
7.2.100.0060.00916.67
7.2.90.0060.00816.56
7.2.80.0030.00916.74
7.2.70.0080.00416.56
7.2.60.0050.00816.68
7.2.50.0090.00616.72
7.2.40.0030.00616.71
7.2.30.0040.01116.91
7.2.20.0030.01016.88
7.2.10.0060.01016.87
7.2.00.0000.01118.15
7.1.330.0070.00715.81
7.1.320.0000.01515.65
7.1.310.0070.00715.90
7.1.300.0030.00915.72
7.1.290.0070.00715.44
7.1.280.0100.00315.62
7.1.270.0030.00915.60
7.1.260.0060.00615.80
7.1.250.0030.00615.55
7.1.240.0000.01315.68
7.1.230.0060.01015.64
7.1.220.0050.00515.47
7.1.210.0110.00415.75
7.1.200.0090.00615.79
7.1.190.0090.00615.94
7.1.180.0030.01015.61
7.1.170.0080.00815.73
7.1.160.0070.00715.39
7.1.150.0100.00315.73
7.1.140.0030.00715.72
7.1.130.0030.01015.88
7.1.120.0040.00815.48
7.1.110.0130.00315.61
7.1.100.0060.00716.87
7.1.90.0160.00415.79
7.1.80.0100.00715.72
7.1.70.0020.00816.36
7.1.60.0090.00417.62
7.1.50.0130.01225.05
7.1.40.0070.00715.60
7.1.30.0110.00315.79
7.1.20.0080.00615.53
7.1.10.0090.00315.80
7.1.00.0080.03819.07
7.0.330.0070.00415.46
7.0.320.0070.00715.55
7.0.310.0000.01215.53
7.0.300.0000.01215.46
7.0.290.0040.00415.34
7.0.280.0000.00815.43
7.0.270.0060.00615.40
7.0.260.0100.00615.36
7.0.250.0070.01015.20
7.0.240.0070.00715.61
7.0.230.0030.01315.04
7.0.220.0030.01015.47
7.0.210.0040.00915.48
7.0.200.0160.01015.09
7.0.190.0070.00715.40
7.0.180.0060.00615.39
7.0.170.0090.00615.36
7.0.160.0030.00715.34
7.0.150.0120.00315.22
7.0.140.0120.00015.40
7.0.130.0100.00315.36
7.0.120.0040.01115.47
7.0.110.0100.00315.07
7.0.100.0100.00715.34
7.0.90.0060.00315.13
7.0.80.0000.01315.45
7.0.70.0100.00615.43
7.0.60.0130.02718.37
7.0.50.0120.04016.54
7.0.40.0120.04216.80
7.0.30.0130.02716.67
7.0.20.0270.04016.73
7.0.10.0090.02016.66
7.0.00.0110.04116.86
5.6.400.0060.00914.46
5.6.390.0090.00614.45
5.6.380.0040.00713.96
5.6.370.0000.00914.37
5.6.360.0040.01214.20
5.6.350.0140.00014.14
5.6.340.0070.01114.13
5.6.330.0120.00314.52
5.6.320.0090.00914.37
5.6.310.0070.00714.40
5.6.300.0000.00814.22
5.6.290.0030.01014.54
5.6.280.0020.02617.77
5.6.270.0080.00414.33
5.6.260.0070.01113.98
5.6.250.0080.00614.32
5.6.240.0030.00613.99
5.6.230.0050.00314.50
5.6.220.0120.00314.20
5.6.210.0130.04217.43
5.6.200.0020.03116.17
5.6.190.0080.04317.40
5.6.180.0170.04617.62
5.6.170.0130.02517.55
5.6.160.0070.02717.46
5.6.150.0030.04216.20
5.6.140.0060.04516.29
5.6.130.0080.04516.23
5.6.120.0050.03117.67
5.6.110.0120.03017.59
5.6.100.0020.02417.53
5.6.90.0100.02317.70
5.6.80.0070.04217.48
5.6.70.0060.01014.27
5.6.60.0000.01113.96
5.6.50.0030.00714.30
5.6.40.0040.01114.07
5.6.30.0110.00714.29
5.6.20.0130.00314.22
5.6.10.0060.00614.07
5.6.00.0090.00314.00
5.5.380.0000.00814.38
5.5.370.0080.00014.16
5.5.360.0030.01214.24
5.5.350.0130.04217.32
5.5.340.0100.04015.92
5.5.330.0030.02917.09
5.5.320.0280.03417.22
5.5.310.0110.02617.30
5.5.300.0040.02416.08
5.5.290.0050.04016.05
5.5.280.0050.03717.35
5.5.270.0070.03017.43
5.5.260.0100.04517.41
5.5.250.0050.05017.37
5.5.240.0130.04317.21
5.5.230.0000.01213.87
5.5.220.0060.00613.95
5.5.210.0000.01214.23
5.5.200.0090.00314.06
5.5.190.0060.00914.07
5.5.180.0080.00813.92
5.5.170.0140.00014.20
5.5.160.0100.00314.26
5.5.150.0060.00814.23
5.5.140.0090.00613.89
5.5.130.0030.00914.15
5.5.120.0060.00814.05
5.5.110.0060.00813.96
5.5.100.0110.00314.25
5.5.90.0000.01114.01
5.5.80.0080.00414.21
5.5.70.0040.01414.40
5.5.60.0070.00714.38
5.5.50.0060.01314.13
5.5.40.0100.00714.18
5.5.30.0160.00013.77
5.5.20.0060.00914.28
5.5.10.0040.00814.07
5.5.00.0000.01513.85

preferences:
58.85 ms | 400 KiB | 5 Q