3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! error_reporting(E_ALL | E_STRICT); $data = array( 'product_id' => 'libgd<script>', 'component' => '11', 'versions' => '2.0.33', 'testscalar' => array('2', '23', '10', '12'), 'testarray' => '2', ); $args = array( 'product_id' => FILTER_SANITIZE_ENCODED, 'component' => array('filter' => FILTER_SANITIZE_NUMBER_INT, 'flags' => FILTER_FORCE_ARRAY, 'options' => array('min_range' => 1, 'max_range' => 10) ), 'versions' => FILTER_SANITIZE_ENCODED, 'doesnotexist' => FILTER_VALIDATE_INT, 'testscalar' => array( 'filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_SCALAR, ), 'testarray' => array( 'filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_FORCE_ARRAY, ) ); $myinputs = filter_var_array($data, $args); var_dump($myinputs); echo "\n";

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0050.00519.48
7.1.100.0040.00817.70
7.1.70.0000.00716.81
7.1.60.0000.01017.18
7.1.50.0000.02016.85
7.1.00.0030.07722.35
7.0.200.0000.01816.53
7.0.140.0030.07321.98
7.0.60.0030.04319.82
7.0.50.0030.06717.85
7.0.40.0070.05317.69
7.0.30.0000.07017.75
7.0.20.0100.05317.85
7.0.10.0170.07017.73
7.0.00.0030.08717.75
5.6.280.0130.06321.02
5.6.210.0070.03720.75
5.6.200.0030.04018.26
5.6.190.0070.08318.18
5.6.180.0000.09018.19
5.6.170.0070.08018.19
5.6.160.0070.05318.09
5.6.150.0230.07018.12
5.6.140.0200.06318.11
5.6.130.0100.08318.15
5.6.120.0030.07718.16
5.6.110.0100.08318.23
5.6.100.0100.07718.14
5.6.90.0070.08018.13
5.6.80.0100.07317.53
5.6.70.0070.05017.51
5.6.60.0030.04317.61
5.6.50.0070.03317.61
5.6.40.0070.07317.55
5.6.30.0070.07717.52
5.6.20.0070.03717.54
5.6.10.0030.03717.54
5.6.00.0070.03317.52
5.5.350.0000.07320.42
5.5.340.0030.03717.99
5.5.330.0030.08718.06
5.5.320.0100.07717.96
5.5.310.0100.06317.93
5.5.300.0030.08717.98
5.5.290.0070.08318.00
5.5.280.0070.04717.92
5.5.270.0130.07317.91
5.5.260.0070.06018.00
5.5.250.0030.05017.79
5.5.240.0000.05317.30
5.5.230.0100.03717.35
5.5.220.0030.04017.36
5.5.210.0030.04717.36
5.5.200.0100.06317.30
5.5.190.0030.08717.33
5.5.180.0000.07717.27
5.5.160.0030.04717.24
5.5.150.0030.06317.27
5.5.140.0130.07317.26
5.5.130.0030.04717.36
5.5.120.0000.04017.29
5.5.110.0000.08717.32
5.5.100.0030.04717.23
5.5.90.0030.07317.14
5.5.80.0000.04017.26
5.5.70.0070.07717.23
5.5.60.0100.07317.12
5.5.50.0070.03717.22
5.5.40.0030.07017.25
5.5.30.0000.08017.25
5.5.20.0030.06017.18
5.5.10.0070.05317.16
5.5.00.0070.03717.18
5.4.450.0030.08319.42
5.4.440.0030.07019.28
5.4.430.0030.05719.21
5.4.420.0070.04019.33
5.4.410.0100.03719.18
5.4.400.0000.08019.08
5.4.390.0070.03318.99
5.4.380.0200.05718.89
5.4.370.0000.04018.98
5.4.360.0070.03719.05
5.4.350.0030.08319.21
5.4.340.0000.07318.97
5.4.320.0070.03719.11
5.4.310.0070.05018.89
5.4.300.0000.08319.00
5.4.290.0030.07718.98
5.4.280.0000.04018.98
5.4.270.0030.07318.98
5.4.260.0130.06319.07
5.4.250.0100.05318.99
5.4.240.0000.04018.82
5.4.230.0000.08019.05
5.4.220.0070.08019.11
5.4.210.0130.06719.08
5.4.200.0100.07018.82
5.4.190.0000.06318.96
5.4.180.0000.07718.94
5.4.170.0030.04018.97
5.4.160.0070.04718.96
5.4.150.0070.06719.00
5.4.140.0100.07316.28
5.4.130.0030.08016.25
5.4.120.0000.07716.17
5.4.110.0070.08016.18
5.4.100.0100.07316.26
5.4.90.0070.06316.36
5.4.80.0130.03716.34
5.4.70.0070.07016.51
5.4.60.0100.07016.27
5.4.50.0000.05316.14
5.4.40.0070.07016.40
5.4.30.0030.05016.30
5.4.20.0100.06716.25
5.4.10.0130.06716.27
5.4.00.0030.06715.62
5.3.290.0070.04314.63
5.3.280.0070.07714.56
5.3.270.0100.06314.43
5.3.260.0100.07314.57
5.3.250.0070.07314.55
5.3.240.0070.08014.44
5.3.230.0030.07714.42
5.3.220.0100.07314.50
5.3.210.0030.05014.65
5.3.200.0070.04714.53
5.3.190.0100.07714.40
5.3.180.0070.05714.54
5.3.170.0000.04314.64
5.3.160.0070.07014.54
5.3.150.0100.07014.39
5.3.140.0000.05014.52
5.3.130.0030.08314.50
5.3.120.0130.07014.38
5.3.110.0100.07314.64
5.3.100.0030.08313.96
5.3.90.0070.07314.01
5.3.80.0130.06013.77
5.3.70.0100.04013.97
5.3.60.0070.07313.97
5.3.50.0100.06713.92
5.3.40.0070.08013.91
5.3.30.0030.06313.88
5.3.20.0030.05713.48
5.3.10.0030.07713.62
5.3.00.0070.06713.55
5.2.170.0030.03311.19
5.2.160.0100.06011.18
5.2.150.0030.06311.13
5.2.140.0030.04011.14
5.2.130.0000.04011.08
5.2.120.0030.03311.09
5.2.110.0100.05010.91
5.2.100.0070.02711.10
5.2.90.0100.02711.05
5.2.80.0070.06011.07
5.2.70.0100.03711.07
5.2.60.0070.06311.06
5.2.50.0030.06311.17
5.2.40.0100.06010.99
5.2.30.0130.05710.75
5.2.20.0000.05710.74
5.2.10.0070.06310.93
5.2.00.0100.05310.75
5.1.60.0070.0309.92
5.1.50.0000.0609.96
5.1.40.0100.05010.18
5.1.30.0030.05310.43
5.1.20.0070.04310.39
5.1.10.0030.06010.03
5.1.00.0100.05010.04
5.0.50.0030.0238.59
5.0.40.0030.0338.44
5.0.30.0030.0578.29
5.0.20.0030.0338.25
5.0.10.0030.0238.37
5.0.00.0070.0478.14
4.4.90.0030.0207.68
4.4.80.0000.0377.68
4.4.70.0000.0237.68
4.4.60.0030.0207.68
4.4.50.0070.0337.68
4.4.40.0000.0477.68
4.4.30.0000.0377.68
4.4.20.0070.0307.68
4.4.10.0070.0307.68
4.4.00.0030.0407.68
4.3.110.0030.0337.68
4.3.100.0030.0207.68
4.3.90.0070.0307.68
4.3.80.0030.0307.68
4.3.70.0070.0277.68
4.3.60.0000.0377.68
4.3.50.0000.0307.68
4.3.40.0000.0377.68
4.3.30.0070.0237.68
4.3.20.0000.0377.68
4.3.10.0030.0377.68
4.3.00.0030.0137.68