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.70.0140.00417.00
8.3.60.0090.01218.43
8.3.50.0030.01221.39
8.3.40.0070.01118.79
8.3.30.0070.00719.34
8.3.20.0040.00420.34
8.3.10.0040.00422.09
8.3.00.0040.00420.81
8.2.180.0070.01125.92
8.2.170.0170.00019.21
8.2.160.0040.01122.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.76
8.2.110.0040.00721.05
8.2.100.0100.00318.03
8.2.90.0040.00419.47
8.2.80.0000.00817.97
8.2.70.0030.00617.88
8.2.60.0000.00818.05
8.2.50.0050.00318.07
8.2.40.0030.00618.28
8.2.30.0050.00218.35
8.2.20.0040.00417.96
8.2.10.0000.00818.05
8.2.00.0060.00617.99
8.1.280.0150.00425.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0090.00328.09
8.1.240.0060.00322.14
8.1.230.0080.00422.75
8.1.220.0040.00417.91
8.1.210.0030.00618.77
8.1.200.0070.00317.47
8.1.190.0040.00417.78
8.1.180.0060.00318.95
8.1.170.0050.00318.71
8.1.160.0040.00422.30
8.1.150.0070.00318.88
8.1.140.0040.00417.64
8.1.130.0030.00517.54
8.1.120.0040.00417.61
8.1.110.0040.00417.58
8.1.100.0040.00417.58
8.1.90.0000.00717.67
8.1.80.0000.00717.53
8.1.70.0040.00417.58
8.1.60.0060.00317.77
8.1.50.0000.00817.77
8.1.40.0050.00317.68
8.1.30.0040.00417.70
8.1.20.0000.00917.73
8.1.10.0030.00517.76
8.1.00.0030.00617.74
8.0.300.0040.00420.37
8.0.290.0050.00317.00
8.0.280.0040.00418.64
8.0.270.0080.00017.00
8.0.260.0000.00717.13
8.0.250.0000.00717.07
8.0.240.0090.00017.19
8.0.230.0040.00417.15
8.0.220.0040.00417.16
8.0.210.0040.00317.16
8.0.200.0030.00317.24
8.0.190.0000.00717.16
8.0.180.0030.00617.21
8.0.170.0000.00817.05
8.0.160.0030.00616.96
8.0.150.0040.00417.05
8.0.140.0060.00317.13
8.0.130.0060.00013.55
8.0.120.0030.00517.12
8.0.110.0040.00417.16
8.0.100.0040.00417.16
8.0.90.0080.00017.09
8.0.80.0090.00917.17
8.0.70.0040.00417.00
8.0.60.0080.00016.99
8.0.50.0040.00416.99
8.0.30.0090.01017.30
8.0.20.0120.01317.41
8.0.10.0090.00017.08
8.0.00.0100.00817.21
7.4.330.0070.00015.00
7.4.320.0000.00716.79
7.4.300.0030.00316.75
7.4.290.0020.00516.45
7.4.280.0030.00316.79
7.4.270.0000.00716.55
7.4.260.0000.00816.76
7.4.250.0050.00316.64
7.4.240.0040.00416.76
7.4.230.0040.00416.75
7.4.220.0060.01316.75
7.4.210.0090.00816.76
7.4.200.0050.00316.78
7.4.190.0000.00716.72
7.4.160.0030.01316.67
7.4.150.0140.00917.40
7.4.140.0160.00517.86
7.4.130.0130.01016.76
7.4.120.0120.00616.76
7.4.110.0110.00716.84
7.4.100.0070.01116.78
7.4.90.0120.00616.61
7.4.80.0150.00619.39
7.4.70.0130.00316.57
7.4.60.0070.01016.68
7.4.50.0000.00416.71
7.4.40.0080.00822.77
7.4.30.0060.01216.55
7.4.00.0000.01515.13
7.3.330.0050.00013.54
7.3.320.0000.00513.41
7.3.310.0050.00316.57
7.3.300.0030.00316.49
7.3.290.0120.00716.52
7.3.280.0070.00916.51
7.3.270.0110.00717.40
7.3.260.0150.00616.50
7.3.250.0100.00716.66
7.3.240.0100.00916.56
7.3.230.0160.00316.51
7.3.210.0100.00716.42
7.3.200.0070.01019.39
7.3.190.0150.00416.79
7.3.180.0170.00316.59
7.3.170.0060.00916.64
7.3.160.0090.00916.79
7.3.120.0090.00914.71
7.3.70.0080.00814.93
7.3.60.0120.00814.92
7.3.50.0080.00914.84
7.3.40.0100.00215.05
7.3.30.0130.00914.87
7.3.20.0100.01216.66
7.3.10.0090.00916.59
7.3.00.0060.01116.58
7.2.330.0090.00916.65
7.2.320.0130.00416.94
7.2.310.0130.01016.92
7.2.300.0130.00416.63
7.2.290.0040.01316.79
7.2.200.0070.01115.42
7.2.190.0080.01015.31
7.2.180.0050.00815.06
7.2.170.0080.00915.02
7.2.160.0140.00815.25
7.2.150.0060.01016.71
7.2.140.0100.00716.92
7.2.130.0080.00916.83
7.2.120.0120.00816.97
7.2.110.0080.00817.03
7.2.100.0060.01416.90
7.2.90.0100.01116.98
7.2.80.0080.00716.92
7.2.70.0100.01017.00
7.2.60.0080.01016.93
7.2.50.0070.01217.05
7.2.40.0060.00917.05
7.2.30.0110.00917.03
7.2.20.0060.01116.87
7.2.10.0120.00516.82
7.2.00.0070.00817.48
7.1.300.0090.00615.66
7.1.290.0030.00915.74
7.1.280.0050.00615.85
7.1.270.0090.00915.75
7.1.260.0090.00615.66
7.1.250.0080.00815.89
7.1.240.0150.00615.74
7.1.230.0170.00515.85
7.1.220.0180.00515.65
7.1.210.0150.01015.71
7.1.200.0120.01115.74
7.1.190.0140.01615.58
7.1.180.0080.01415.76
7.1.170.0090.01215.73
7.1.160.0180.00815.84
7.1.150.0160.00615.70
7.1.140.0180.00715.54
7.1.130.0160.00715.71
7.1.120.0160.01415.70
7.1.110.0170.00515.77
7.1.100.0070.01416.60
7.1.90.0250.00715.70
7.1.80.0120.01115.79
7.1.70.0120.01116.20
7.1.60.0150.01017.15
7.1.50.0170.01216.21
7.1.40.0270.00315.76
7.1.30.0090.00715.59
7.1.20.0200.00615.76
7.1.10.0160.01015.84
7.1.00.0120.01717.93
7.0.330.0210.00815.33
7.0.320.0160.00915.40
7.0.310.0140.01215.44
7.0.300.0170.01415.30
7.0.290.0080.01315.43
7.0.280.0140.00815.37
7.0.270.0130.01115.55
7.0.260.0120.00715.36
7.0.250.0140.00615.23
7.0.240.0110.01515.50
7.0.230.0150.00715.35
7.0.220.0060.01715.30
7.0.210.0110.01015.43
7.0.200.0650.00615.27
7.0.190.0150.01015.46
7.0.180.0150.01215.44
7.0.170.0140.01115.50
7.0.160.0140.01015.28
7.0.150.0130.00615.36
7.0.140.0110.03217.54
7.0.130.0180.00715.49
7.0.120.0180.01015.42
7.0.110.0310.03317.03
7.0.100.0330.03316.97
7.0.90.0320.02516.93
7.0.80.0400.03117.03
7.0.70.0350.02716.92
7.0.60.0370.03316.85
7.0.50.0360.03416.97
7.0.40.0110.03416.76
7.0.30.0140.02916.80
7.0.20.0120.02716.83
7.0.10.0110.03416.85
7.0.00.0170.02716.94
5.6.400.0150.01214.39
5.6.390.0230.00714.88
5.6.380.0160.01114.93
5.6.370.0220.01014.86
5.6.360.0130.01215.03
5.6.350.0170.00714.87
5.6.340.0190.00615.03
5.6.330.0190.00714.95
5.6.320.0120.01014.71
5.6.310.0170.00614.81
5.6.300.0180.00814.57
5.6.290.0180.00914.71
5.6.280.0120.03316.94
5.6.270.0150.00714.97
5.6.260.0160.03216.75
5.6.250.0160.03016.79
5.6.240.0150.03516.75
5.6.230.0160.03216.75
5.6.220.0150.03416.79
5.6.210.0090.03116.83
5.6.200.0100.03516.72
5.6.190.0100.03216.83
5.6.180.0210.02916.77
5.6.170.0180.02316.90
5.6.160.0110.03516.84
5.6.150.0190.03116.85
5.6.140.0120.03516.83
5.6.130.0100.03116.74
5.6.120.0080.02716.75
5.6.110.0080.03716.70
5.6.100.0160.03416.69
5.6.90.0130.03416.84
5.6.80.0180.02616.51
5.6.70.0110.03616.66
5.6.60.0180.03016.51
5.6.50.0100.03516.48
5.6.40.0110.03416.54
5.6.30.0120.03416.61
5.6.20.0140.02716.48
5.6.10.0130.02316.55
5.6.00.0180.03416.48
5.5.380.0080.04016.54
5.5.370.0100.03616.51
5.5.360.0150.03016.64
5.5.350.0080.03116.44
5.5.340.0110.02616.70
5.5.330.0180.02016.74
5.5.320.0130.02416.59
5.5.310.0130.02416.81
5.5.300.0150.03516.73
5.5.290.0140.03416.64
5.5.280.0180.03116.67
5.5.270.0150.03316.77
5.5.260.0180.03316.66
5.5.250.0100.03516.65
5.5.240.0120.03416.35
5.5.230.0150.02416.53
5.5.220.0110.02616.44
5.5.210.0180.01616.38
5.5.200.0160.03316.47
5.5.190.0160.02916.39
5.5.180.0130.02916.59
5.5.170.0170.00614.36
5.5.160.0140.03716.30
5.5.150.0170.02816.21
5.5.140.0130.02716.42
5.5.130.0130.03216.36
5.5.120.0120.03116.55
5.5.110.0140.02816.23
5.5.100.0140.03216.28
5.5.90.0080.02816.34
5.5.80.0080.03616.41
5.5.70.0150.03216.40
5.5.60.0180.02916.41
5.5.50.0110.03416.47
5.5.40.0150.03116.40
5.5.30.0130.03216.42
5.5.20.0080.03616.22
5.5.10.0100.03616.30
5.5.00.0110.03516.30
5.4.450.0090.03114.03
5.4.440.0160.02714.11
5.4.430.0120.02013.96
5.4.420.0080.03513.86
5.4.410.0120.02913.90
5.4.400.0080.03113.79
5.4.390.0070.03113.92
5.4.380.0080.03013.92
5.4.370.0090.02313.87
5.4.360.0150.02613.92
5.4.350.0090.02913.97
5.4.340.0100.02913.85
5.4.330.0070.00911.35
5.4.320.0120.02913.84
5.4.310.0090.02513.85
5.4.300.0060.03113.81
5.4.290.0130.01813.90
5.4.280.0120.02813.99
5.4.270.0060.02814.01
5.4.260.0080.02713.89
5.4.250.0140.02413.84
5.4.240.0100.02013.76
5.4.230.0140.02413.91
5.4.220.0090.02813.94
5.4.210.0130.02713.83
5.4.200.0140.01713.87
5.4.190.0080.03213.90
5.4.180.0080.02913.86
5.4.170.0080.03013.87
5.4.160.0100.02613.93
5.4.150.0080.03013.91
5.4.140.0120.02312.99
5.4.130.0090.02013.13
5.4.120.0070.03013.12
5.4.110.0060.03013.06
5.4.100.0120.02913.12
5.4.90.0160.02213.02
5.4.80.0140.02313.05
5.4.70.0090.01613.05
5.4.60.0070.02713.03
5.4.50.0150.02613.08
5.4.40.0120.02513.11
5.4.30.0120.02113.14
5.4.20.0090.01812.97
5.4.10.0110.02813.06
5.4.00.0090.02812.88
5.3.290.0080.02912.16
5.3.280.0090.03012.05
5.3.270.0080.03112.08
5.3.260.0110.01712.03
5.3.250.0090.01712.11
5.3.240.0120.02311.99
5.3.230.0050.02612.01
5.3.220.0070.02212.10
5.3.210.0110.02712.01
5.3.200.0050.03412.10
5.3.190.0110.03112.13
5.3.180.0060.03012.11
5.3.170.0120.02712.23
5.3.160.0050.03512.11
5.3.150.0090.02712.15
5.3.140.0080.02712.13
5.3.130.0090.02512.20
5.3.120.0110.02812.15
5.3.110.0110.02812.16
5.3.100.0060.03012.06
5.3.90.0110.02711.99
5.3.80.0080.02911.89
5.3.70.0160.02411.74
5.3.60.0120.01411.84
5.3.50.0100.02811.85
5.3.40.0100.02611.79
5.3.30.0090.02411.61
5.3.20.0100.02711.74
5.3.10.0090.02511.58
5.3.00.0120.02411.68
5.2.170.0110.0069.95
5.2.160.0060.0149.95
5.2.150.0070.0059.95
5.2.140.0090.0049.95
5.2.130.0060.0049.95
5.2.120.0120.0019.95
5.2.110.0050.0099.95
5.2.100.0110.0039.95
5.2.90.0140.0009.95
5.2.80.0120.0069.95
5.2.70.0100.0069.95
5.2.60.0120.0069.95
5.2.50.0110.0069.95
5.2.40.0100.0069.95
5.2.30.0100.0059.95
5.2.20.0070.0089.95
5.2.10.0080.0069.95
5.2.00.0120.0059.95
5.1.60.0080.0079.95
5.1.50.0050.0089.95
5.1.40.0050.0079.95
5.1.30.0110.0069.95
5.1.20.0060.0079.95
5.1.10.0120.0029.95
5.1.00.0130.0029.95
5.0.50.0050.0089.95
5.0.40.0060.0049.95
5.0.30.0090.0039.95
5.0.20.0070.0039.95
5.0.10.0080.0049.95
5.0.00.0050.0079.95
4.4.90.0080.0039.95
4.4.80.0050.0059.95
4.4.70.0040.0059.95
4.4.60.0060.0049.95
4.4.50.0060.0029.95
4.4.40.0010.0049.95
4.4.30.0030.0059.95
4.4.20.0080.0039.95
4.4.10.0090.0019.95
4.4.00.0050.0059.95
4.3.110.0060.0039.95
4.3.100.0050.0019.95
4.3.90.0060.0049.95
4.3.80.0040.0069.95
4.3.70.0070.0049.95
4.3.60.0060.0049.95
4.3.50.0060.0009.95
4.3.40.0050.0049.95
4.3.30.0060.0019.95
4.3.20.0000.0059.95
4.3.10.0070.0029.95
4.3.00.0030.0059.95

preferences:
61.47 ms | 401 KiB | 5 Q