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); }

preferences:
81.66 ms | 402 KiB | 5 Q