3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['vector'] = 'print(print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))."<br><hr>")'; $vector = $_GET['vector']; try{ $vector = $_GET['vector']; echo "eval:<br>"; eval($vector); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "assert:<br>"; assert($vector); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "preg_replace:<br>"; preg_replace("//e",$vector,''); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "preg_filter:<br>"; preg_filter("//e",$vector,''); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "mb_ereg_replace:<br>"; mb_ereg_replace("//e",$vector,'wee'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "mb_eregi_replace:<br>"; mb_eregi_replace("//e",$vector,'wee'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "create_function:<br>"; $function = create_function('$vector',"return $vector;"); $function($vector); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "filter_var:<br>"; filter_var($vector, FILTER_CALLBACK, array('options' => 'assert')); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "filter_input:<br>"; filter_input(INPUT_GET, 'vector', FILTER_CALLBACK, array('options' => 'assert')); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "filter_var_array:<br>"; filter_var_array(array('vector' => $vector), array('vector' => array( 'filter' => FILTER_CALLBACK, 'options' => 'assert'))); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "filter_input_array:<br>"; filter_input_array(INPUT_GET, array( 'vector' => array( 'filter' => FILTER_CALLBACK, 'options' => 'assert'))); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "call_user_func_array:<br>"; call_user_func_array($function, array($vector)); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "spl_autoload_register:<br>"; function foo() {global $vector; eval($vector); } spl_autoload_register('foo');// new NonExistedClass; }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "iterator_apply:<br>"; iterator_apply(new ArrayIterator(array(1)), "assert", array($vector)); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "curl_exec:<br>"; /*$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://google.com/'); curl_setopt($ch, CURLOPT_HEADERFUNCTION, '$vector'); curl_exec($ch); curl_close($ch);*/ }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "session_set_save_handler:<br>"; session_set_save_handler($vector, true); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "preg_replace_callback:<br>"; preg_replace_callback("/$vector/","assert",''); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_map:<br>"; array_map('assert', array($vector)); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_filter:<br>"; array_filter(array($vector), 'assert'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_reduce:<br>"; array_reduce(array($vector), 'call_user_func', 'assert'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_diff_uassoc:<br>"; array_diff_uassoc(array($vector => 1, 'assert' => 1), array(), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_diff_ukey:<br>"; array_diff_ukey(array('assert' => 1), array($vector => 1), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_udiff:<br>"; array_udiff(array('assert'), array($vector), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_udiff_assoc:<br>"; array_udiff_assoc(array('assert'), array($vector), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_diff_uassoc:<br>"; array_diff_uassoc(array('assert' => 1), array($vector => 1), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_intersect_uassoc:<br>"; array_intersect_uassoc(array($vector => 1, 'assert' => 1), array(), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_intersect_ukey:<br>"; array_intersect_ukey(array('assert' => 1), array($vector => 1), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_uintersect:<br>"; array_uintersect(array($vector, 'assert'), array(), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_uintersect_assoc:<br>"; array_uintersect_assoc(array('assert'), array($vector), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_uintersect_uassoc:<br>"; $a = array('assert' => 'assert'); $b = array("print'register_shutdown_function'" => "print'call_user_func'"); array_uintersect_uassoc($a, $b, 'call_user_func', 'register_shutdown_function'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_walk:<br>"; array_walk($c = array($vector => 'assert'), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "array_walk_recursive:<br>"; array_walk_recursive($c = array($vector => 'assert'), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "call_user_func:<br>"; call_user_func('assert', $vector); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "call_user_func_array:<br>"; call_user_func_array('assert', array($vector)); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "iterator_apply:<br>"; iterator_apply(new ArrayIterator(array(1)), 'call_user_func', array('assert', $vector)); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "register_shutdown_function:<br>"; register_shutdown_function('assert', $vector); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "usort:<br>"; usort($c = array($vector, 'assert'), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "uasort:<br>"; uasort($c = array(1 => $vector, 2 => 'assert'), 'call_user_func'); }catch(Exception $e){ print_r(e); } try{ $vector = $_GET['vector']; echo "uksort:<br>"; uksort($c = array($vector => 1, 'assert' => 1), 'call_user_func'); }catch(Exception $e){ print_r(e); }

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.47
8.3.50.0090.00721.33
8.3.40.0070.01118.98
8.3.30.0070.00719.22
8.3.20.0040.00420.29
8.3.10.0040.00422.04
8.3.00.0030.00620.71
8.2.180.0060.01316.86
8.2.170.0110.00422.96
8.2.160.0110.01119.33
8.2.150.0050.00324.18
8.2.140.0150.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00019.66
8.2.110.0120.00022.26
8.2.100.0060.00717.97
8.2.90.0040.00419.33
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0040.00418.17
8.2.50.0040.00418.07
8.2.40.0050.00318.28
8.2.30.0000.00818.22
8.2.20.0030.00618.00
8.2.10.0040.00417.99
8.2.00.0030.00717.91
8.1.280.0110.00425.92
8.1.270.0000.00818.75
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00721.12
8.1.230.0060.00617.57
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0050.00517.60
8.1.190.0040.00417.68
8.1.180.0080.00020.44
8.1.170.0000.00818.84
8.1.160.0040.00422.31
8.1.150.0030.00718.89
8.1.140.0030.00517.67
8.1.130.0000.00717.99
8.1.120.0030.00617.67
8.1.110.0050.00317.68
8.1.100.0040.00417.61
8.1.90.0040.00417.64
8.1.80.0040.00417.59
8.1.70.0000.00717.59
8.1.60.0080.00017.61
8.1.50.0030.00617.57
8.1.40.0000.00817.67
8.1.30.0040.00417.82
8.1.20.0090.00017.67
8.1.10.0000.01017.65
8.1.00.0000.00817.61
8.0.300.0020.00518.77
8.0.290.0030.00516.88
8.0.280.0030.00518.56
8.0.270.0040.00417.42
8.0.260.0030.00316.93
8.0.250.0070.00017.22
8.0.240.0050.00317.10
8.0.230.0000.00817.10
8.0.220.0040.00417.02
8.0.210.0070.00017.16
8.0.200.0000.00717.08
8.0.190.0040.00417.11
8.0.180.0090.00017.06
8.0.170.0000.00817.16
8.0.160.0040.00417.11
8.0.150.0040.00417.07
8.0.140.0040.00417.00
8.0.130.0030.00313.63
8.0.120.0000.00816.98
8.0.110.0000.00817.16
8.0.100.0000.00816.98
8.0.90.0040.00417.05
8.0.80.0090.01017.19
8.0.70.0040.00417.11
8.0.60.0040.00417.04
8.0.50.0040.00417.07
8.0.30.0130.00617.30
8.0.20.0090.01017.49
8.0.10.0040.00417.15
8.0.00.0110.00816.86
7.4.330.0040.00415.00
7.4.320.0030.00316.81
7.4.300.0030.00316.78
7.4.290.0000.00816.61
7.4.280.0050.00216.71
7.4.270.0030.00316.70
7.4.260.0000.00716.61
7.4.250.0050.00316.64
7.4.240.0040.00416.77
7.4.230.0000.00716.77
7.4.220.0100.01616.73
7.4.210.0110.00516.81
7.4.200.0040.00416.69
7.4.190.0070.00016.95
7.4.160.0170.00016.74
7.4.150.0070.01117.40
7.4.140.0060.01217.86
7.4.130.0100.00816.72
7.4.120.0090.00816.67
7.4.110.0150.00316.82
7.4.100.0100.01016.80
7.4.90.0100.00716.80
7.4.80.0130.00719.39
7.4.70.0080.01116.59
7.4.60.0090.00916.83
7.4.50.0000.00916.92
7.4.40.0040.01122.77
7.4.30.0100.00716.82
7.4.00.0030.01214.94
7.3.330.0030.00313.61
7.3.320.0030.00313.56
7.3.310.0070.00016.39
7.3.300.0040.00416.40
7.3.290.0070.01316.54
7.3.280.0080.00816.57
7.3.270.0110.00717.40
7.3.260.0090.00916.76
7.3.250.0040.01316.72
7.3.240.0160.00416.63
7.3.230.0040.01716.52
7.3.210.0030.01316.58
7.3.200.0060.01219.39
7.3.190.0100.01016.52
7.3.180.0080.00816.62
7.3.170.0090.00616.53
7.3.160.0070.01016.70
7.3.120.0080.00815.02
7.2.330.0150.00417.03
7.2.320.0030.01417.00
7.2.310.0100.00916.86
7.2.300.0170.00616.98
7.2.290.0140.00317.02
7.2.60.0060.01016.83
7.2.00.0060.00619.54
7.1.200.0000.01115.83
7.1.100.0030.00617.64
7.1.70.0060.00617.23
7.1.60.0100.01319.82
7.1.50.0130.01017.02
7.1.00.0000.03722.33
7.0.200.0550.00515.01
7.0.140.0000.07721.98
7.0.100.0230.07020.16
7.0.90.0000.08720.15
7.0.80.0070.05320.12
7.0.70.0330.07720.02
7.0.60.0300.08020.04
7.0.50.0100.08020.50
7.0.40.0070.04720.18
7.0.30.0070.06020.04
7.0.20.0100.07320.11
7.0.10.0100.08320.05
7.0.00.0000.05020.10
5.6.280.0070.07721.11
5.6.250.0130.05020.72
5.6.240.0130.05320.67
5.6.230.0200.06320.78
5.6.220.0100.08720.67
5.6.210.0100.08020.83
5.6.200.0130.07721.21
5.6.190.0100.09021.19
5.6.180.0130.08021.21
5.6.170.0170.08321.24
5.6.160.0070.04721.30
5.6.150.0070.04721.27
5.6.140.0030.04721.11
5.6.130.0070.04721.26
5.6.120.0070.04321.29
5.6.110.0130.03721.10
5.6.100.0100.04021.19
5.6.90.0130.04321.18
5.6.80.0100.03720.50
5.6.70.0070.03720.59
5.6.60.0100.06720.66
5.6.50.0200.05320.49
5.6.40.0000.05020.57
5.6.30.0070.04720.62
5.6.20.0100.04020.44
5.6.10.0070.05020.62
5.6.00.0130.03320.43
5.5.380.0100.08320.49
5.5.370.0130.06720.43
5.5.360.0070.08020.60
5.5.350.0130.07020.52
5.5.340.0170.06020.71
5.5.330.0100.08720.84
5.5.320.0200.07020.98
5.5.310.0100.08320.98
5.5.300.0000.05320.99
5.5.290.0130.03720.95
5.5.280.0070.05020.84
5.5.270.0070.03320.85
5.5.260.0000.04720.85
5.5.250.0100.04020.65
5.5.240.0030.03720.28
5.5.230.0100.04020.28
5.5.220.0100.05020.33
5.5.210.0070.05320.24
5.5.200.0030.04320.34
5.5.190.0100.03720.28
5.5.180.0100.03720.18
5.5.160.0000.04320.30
5.5.150.0070.04020.16
5.5.140.0170.03320.21
5.5.130.0130.03320.05
5.5.120.0130.03720.34
5.5.110.0070.03320.32
5.5.100.0130.04020.17
5.5.90.0030.04320.20
5.5.80.0130.03720.22
5.5.70.0030.05020.03
5.5.60.0130.03320.13
5.5.50.0130.04320.07
5.5.40.0030.04320.22
5.5.30.0070.05020.20
5.5.20.0130.07020.14
5.5.10.0200.06720.11
5.5.00.0130.06720.07
5.4.450.0070.04319.47
5.4.440.0030.04319.19
5.4.430.0070.03719.23
5.4.420.0070.04019.53
5.4.410.0000.04719.23
5.4.400.0070.04719.37
5.4.390.0100.05319.16
5.4.380.0030.04019.16
5.4.370.0070.03719.14
5.4.360.0030.06719.05
5.4.350.0030.03719.05
5.4.340.0070.05718.87
5.4.320.0030.05319.04
5.4.310.0070.04019.13
5.4.300.0130.03018.85
5.4.290.0070.04019.14
5.4.280.0100.04719.00
5.4.270.0070.04719.23
5.4.260.0030.03719.13
5.4.250.0070.03318.90
5.4.240.0030.04019.11
5.4.230.0070.04019.09
5.4.220.0070.04019.06
5.4.210.0070.03719.15
5.4.200.0130.03319.03
5.4.190.0070.04019.08
5.4.180.0100.07319.02
5.4.170.0030.06719.04
5.4.160.0070.04319.03
5.4.150.0200.07018.86
5.4.140.0130.07016.41
5.4.130.0100.04316.43
5.4.120.0170.07316.43
5.4.110.0170.07016.45
5.4.100.0030.04316.35
5.4.90.0100.07716.42
5.4.80.0170.04716.55
5.4.70.0170.06716.33
5.4.60.0000.07316.38
5.4.50.0130.06716.37
5.4.40.0070.05316.37
5.4.30.0200.06016.31
5.4.20.0170.06716.32
5.4.10.0170.07016.51
5.4.00.0070.04315.78
5.3.290.0100.04014.80
5.3.280.0030.04014.75
5.3.270.0130.07714.64
5.3.260.0100.07314.66
5.3.250.0100.07014.69
5.3.240.0000.07014.73
5.3.230.0130.04014.68
5.3.220.0130.07314.66
5.3.210.0100.04014.79
5.3.200.0070.06714.62
5.3.190.0230.03314.61
5.3.180.0200.07014.73
5.3.170.0100.06314.77
5.3.160.0170.06714.66
5.3.150.0100.07714.68
5.3.140.0070.07714.61
5.3.130.0130.07014.71
5.3.120.0070.06314.76
5.3.110.0070.08314.72
5.3.100.0130.07314.15
5.3.90.0200.07014.05
5.3.80.0170.06714.21
5.3.70.0200.07014.11
5.3.60.0030.06014.21
5.3.50.0130.08014.09
5.3.40.0230.07713.94
5.3.30.0100.04714.05
5.3.20.0130.08013.86
5.3.10.0270.06313.82
5.3.00.0170.06313.87

preferences:
38.65 ms | 401 KiB | 5 Q