3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ( [ 'array' => ['foo'], 'string' => 'foo', 'int' => 3, 'class' => new stdClass(), 'good input' => 'foo@bar.com' ] as $inputName => $input) { foreach ( [ 'validate' => FILTER_VALIDATE_EMAIL, 'sanitize' => FILTER_SANITIZE_EMAIL, ] as $filerName => $filter ) { foreach( [ 'none' => [], 'default of int 5' => ['options' => ['default' => 5]], 'default with null failure' => ['flags' => FILTER_NULL_ON_FAILURE, 'options' => ['default' => 5]], 'null failure' => ['flags' => FILTER_NULL_ON_FAILURE], 'default with null failue and force array' => ['flags' => FILTER_NULL_ON_FAILURE | FILTER_FORCE_ARRAY, 'options' => ['default' => 5]], 'default with force array' => ['flags' => FILTER_FORCE_ARRAY, 'options' => ['default' => 5]], 'force array' => ['flags' => FILTER_FORCE_ARRAY], ] as $optionsName => $options) { echo "$inputName\t$filerName\t$optionsName\n"; var_dump(filter_var($input, $filter, $options)); } } }

Abusive script

This script was stopped while abusing our resources

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.110.0070.00320.94
8.3.100.0030.00624.06
8.3.90.0050.00526.77
8.3.80.0000.01117.13
8.3.70.0120.00917.13
8.3.60.0070.01117.13
8.3.50.0130.01123.88
8.3.40.0120.00419.47
8.3.30.0110.01119.34
8.3.20.0060.00321.37
8.3.10.0030.00622.22
8.3.00.0060.00321.98
8.2.230.0050.00522.58
8.2.220.0090.00037.54
8.2.210.0130.00726.77
8.2.200.0160.00416.73
8.2.190.0160.00317.00
8.2.180.0070.01618.79
8.2.170.0200.00022.96
8.2.160.0090.00622.49
8.2.150.0050.00524.18
8.2.140.0000.00824.66
8.2.130.0030.00626.16
8.2.120.0060.00326.16
8.2.110.0070.00321.32
8.2.100.0070.00718.41
8.2.90.0000.00818.59
8.2.80.0040.00418.18
8.2.70.0030.00718.05
8.2.60.0030.00718.53
8.2.50.0000.01118.13
8.2.40.0040.00419.92
8.2.30.0030.00619.64
8.2.20.0040.00418.62
8.2.10.0060.00319.83
8.2.00.0040.00419.85
8.1.290.0050.00518.88
8.1.280.0040.01225.92
8.1.270.0040.00421.25
8.1.260.0150.00626.35
8.1.250.0040.00428.09
8.1.240.0080.00618.20
8.1.230.0040.01121.34
8.1.220.0040.00418.16
8.1.210.0060.00321.32
8.1.200.0100.00017.86
8.1.190.0030.00617.72
8.1.180.0040.00418.10
8.1.170.0060.00319.03
8.1.160.0060.00319.32
8.1.150.0040.00418.98
8.1.140.0040.00421.00
8.1.130.0000.00722.32
8.1.120.0030.00517.75
8.1.110.0040.00417.86
8.1.100.0000.00917.71
8.1.90.0080.00017.79
8.1.80.0080.00017.85
8.1.70.0020.00517.81
8.1.60.0060.00317.94
8.1.50.0060.00317.88
8.1.40.0060.00317.80
8.1.30.0000.00917.98
8.1.20.0000.00817.88
8.1.10.0000.00817.86
8.1.00.0070.00719.96
8.0.300.0060.00320.16
8.0.290.0040.00817.13
8.0.280.0000.00818.70
8.0.270.0020.00518.36
8.0.260.0040.00420.18
8.0.250.0000.00917.29
8.0.240.0030.00517.27
8.0.230.0020.00517.29
8.0.220.0000.00717.25
8.0.210.0030.00617.26
8.0.200.0000.00717.27
8.0.190.0000.00817.17
8.0.180.0030.00617.26
8.0.170.0060.00317.12
8.0.160.0000.00817.23
8.0.150.0050.00517.15
8.0.140.0000.00917.18
8.0.130.0030.00313.71
8.0.120.0000.00817.20
8.0.110.0000.00817.11
8.0.100.0030.00517.34
8.0.90.0030.00617.30
8.0.80.0140.00317.22
8.0.70.0000.00817.10
8.0.60.0000.00917.30
8.0.50.0080.00017.26
8.0.30.0090.01117.67
8.0.20.0140.00917.43
8.0.10.0030.00617.36
8.0.00.0060.01217.11
7.4.330.0000.00616.92
7.4.320.0040.00416.97
7.4.300.0030.00316.95
7.4.290.0030.00616.93
7.4.280.0000.00817.08
7.4.270.0050.00216.95
7.4.260.0030.00713.67
7.4.250.0030.00716.92
7.4.240.0020.00616.94
7.4.230.0000.00817.06
7.4.220.0010.00717.01
7.4.210.0030.01516.86
7.4.200.0030.00617.16
7.4.130.0110.01116.79
7.4.120.0110.00816.79
7.4.110.0160.01316.90
7.4.100.0190.00916.75
7.4.90.0170.00317.03
7.4.80.0070.01319.39
7.4.70.0130.00616.82
7.4.60.0000.01816.83
7.4.50.0070.01016.86
7.4.40.0100.01016.89
7.4.10.0140.00715.26
7.4.00.0030.01515.28
7.3.330.0080.00416.53
7.3.320.0030.00313.57
7.3.310.0080.00016.64
7.3.300.0040.00416.76
7.3.290.0050.01316.70
7.3.280.0070.01016.59
7.3.260.0170.00816.57
7.3.240.0130.01016.77
7.3.230.0100.01116.63
7.3.210.0030.01916.88
7.3.200.0040.02016.99
7.3.190.0110.00816.58
7.3.180.0070.01316.48
7.3.170.0140.00816.59
7.3.160.0160.00416.95
7.3.130.0070.01115.27
7.3.120.0160.00815.01
7.3.110.0030.01715.24
7.3.100.0130.01315.21
7.3.90.0080.01215.00
7.3.80.0130.01115.16
7.3.70.0110.00815.03
7.3.60.0130.00615.08
7.3.50.0200.00915.16
7.3.40.0070.01014.96
7.3.30.0140.00914.79
7.3.20.0080.01214.91
7.3.10.0100.01015.12
7.3.00.0150.00715.15
7.2.330.0070.01416.75
7.2.320.0120.00916.98
7.2.310.0050.00817.04
7.2.300.0100.01717.04
7.2.290.0180.00717.00
7.2.260.0030.01715.06
7.2.250.0060.01515.43
7.2.240.0110.01415.32
7.2.230.0130.00615.41
7.2.220.0090.00915.39
7.2.210.0100.01415.25
7.2.200.0090.01215.05
7.2.190.0080.01215.20
7.2.180.0080.01715.19
7.2.170.0060.01215.38
7.2.160.0170.00915.20
7.2.150.0100.01615.32
7.2.140.0120.01215.38
7.2.130.0140.00915.19
7.2.120.0160.00415.38
7.2.110.0160.00315.43
7.2.100.0140.01015.32
7.2.90.0120.01215.54
7.2.80.0130.01015.24
7.2.70.0180.00315.21
7.2.60.0350.01015.16
7.2.50.0140.00615.50
7.2.40.0140.00715.57
7.2.30.0100.01615.49
7.2.20.0130.00815.38
7.2.10.0160.00315.48
7.2.00.0080.01115.28

preferences:
29.52 ms | 403 KiB | 5 Q