3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); }
Output for 7.0.0 - 7.1.0
Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected end of file in /in/vqhi9(11) : eval()'d code on line 1
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected end of file in /in/vqhi9(11) : eval()'d code on line 1 assert:<br>preg_replace:<br> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/vqhi9 on line 27 preg_filter:<br> Deprecated: preg_filter(): The /e modifier is deprecated, use preg_replace_callback instead in /in/vqhi9 on line 35 mb_ereg_replace:<br>mb_eregi_replace:<br>create_function:<br>filter_var:<br>filter_input:<br>filter_var_array:<br>filter_input_array:<br>call_user_func_array:<br>spl_autoload_register:<br>iterator_apply:<br>curl_exec:<br>session_set_save_handler:<br> Warning: session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, integer given in /in/vqhi9 on line 138 preg_replace_callback:<br>array_map:<br>array_filter:<br>array_reduce:<br>array_diff_uassoc:<br>array_diff_ukey:<br>array_udiff:<br>array_udiff_assoc:<br>array_diff_uassoc:<br>array_intersect_uassoc:<br>array_intersect_ukey:<br>array_uintersect:<br>array_uintersect_assoc:<br>array_uintersect_uassoc:<br>call_user_funcarray_walk:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 273 array_walk_recursive:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 282 call_user_func:<br>call_user_func_array:<br>iterator_apply:<br>register_shutdown_function:<br>usort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 327 uasort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 336 uksort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 345 register_shutdown_function
Output for 5.4.11 - 5.4.45
Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected end of file in /in/vqhi9(11) : eval()'d code on line 1 assert:<br>preg_replace:<br>preg_filter:<br>mb_ereg_replace:<br>mb_eregi_replace:<br>create_function:<br>filter_var:<br>filter_input:<br>filter_var_array:<br>filter_input_array:<br>call_user_func_array:<br>spl_autoload_register:<br>iterator_apply:<br>curl_exec:<br>session_set_save_handler:<br> Warning: session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, integer given in /in/vqhi9 on line 138 preg_replace_callback:<br>array_map:<br>array_filter:<br>array_reduce:<br>array_diff_uassoc:<br>array_diff_ukey:<br>array_udiff:<br>array_udiff_assoc:<br>array_diff_uassoc:<br>array_intersect_uassoc:<br>array_intersect_ukey:<br>array_uintersect:<br>array_uintersect_assoc:<br>array_uintersect_uassoc:<br>call_user_funcarray_walk:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 273 array_walk_recursive:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 282 call_user_func:<br>call_user_func_array:<br>iterator_apply:<br>register_shutdown_function:<br>usort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 327 uasort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 336 uksort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 345 register_shutdown_function
Output for 5.4.0 - 5.4.10
Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected end of file in /in/vqhi9(11) : eval()'d code on line 1 assert:<br>preg_replace:<br>preg_filter:<br>mb_ereg_replace:<br>mb_eregi_replace:<br>create_function:<br>filter_var:<br>filter_input:<br>filter_var_array:<br>filter_input_array:<br>call_user_func_array:<br>spl_autoload_register:<br>iterator_apply:<br>curl_exec:<br>session_set_save_handler:<br> Warning: session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, integer given in /in/vqhi9 on line 138 preg_replace_callback:<br>array_map:<br>array_filter:<br>array_reduce:<br>array_diff_uassoc:<br>array_diff_ukey:<br>array_udiff:<br>array_udiff_assoc:<br>array_diff_uassoc:<br>array_intersect_uassoc:<br>array_intersect_ukey:<br>array_uintersect:<br>array_uintersect_assoc:<br>array_uintersect_uassoc:<br>call_user_funcarray_walk:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 273 array_walk_recursive:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 282 call_user_func:<br>call_user_func_array:<br>iterator_apply:<br>register_shutdown_function:<br>usort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 327 uasort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 336 uksort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 345 register_shutdown_function
Process exited with code 255.
Output for 5.3.6 - 5.3.29
Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected $end in /in/vqhi9(11) : eval()'d code on line 1 assert:<br>preg_replace:<br>preg_filter:<br>mb_ereg_replace:<br>mb_eregi_replace:<br>create_function:<br>filter_var:<br>filter_input:<br>filter_var_array:<br>filter_input_array:<br>call_user_func_array:<br>spl_autoload_register:<br>iterator_apply:<br>curl_exec:<br>session_set_save_handler:<br> Warning: Wrong parameter count for session_set_save_handler() in /in/vqhi9 on line 138 preg_replace_callback:<br>array_map:<br>array_filter:<br>array_reduce:<br>array_diff_uassoc:<br>array_diff_ukey:<br>array_udiff:<br>array_udiff_assoc:<br>array_diff_uassoc:<br>array_intersect_uassoc:<br>array_intersect_ukey:<br>array_uintersect:<br>array_uintersect_assoc:<br>array_uintersect_uassoc:<br>call_user_funcarray_walk:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 273 array_walk_recursive:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 282 call_user_func:<br>call_user_func_array:<br>iterator_apply:<br>register_shutdown_function:<br>usort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 327 uasort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 336 uksort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 345 register_shutdown_function
Process exited with code 255.
Output for 5.3.0 - 5.3.5
Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in /in/vqhi9 on line 3 Array ( ) 1<br><hr>eval:<br> Parse error: syntax error, unexpected $end in /in/vqhi9(11) : eval()'d code on line 1 assert:<br>preg_replace:<br>preg_filter:<br>mb_ereg_replace:<br>mb_eregi_replace:<br>create_function:<br>filter_var:<br>filter_input:<br>filter_var_array:<br>filter_input_array:<br>call_user_func_array:<br>spl_autoload_register:<br>iterator_apply:<br>curl_exec:<br>session_set_save_handler:<br> Warning: Wrong parameter count for session_set_save_handler() in /in/vqhi9 on line 138 preg_replace_callback:<br>array_map:<br>array_filter:<br>array_reduce:<br>array_diff_uassoc:<br>array_diff_ukey:<br>array_udiff:<br>array_udiff_assoc:<br>array_diff_uassoc:<br>array_intersect_uassoc:<br>array_intersect_ukey:<br>array_uintersect:<br>array_uintersect_assoc:<br>array_uintersect_uassoc:<br>call_user_funcarray_walk:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 273 array_walk_recursive:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 282 call_user_func:<br>call_user_func_array:<br>iterator_apply:<br>register_shutdown_function:<br>usort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 327 uasort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 336 uksort:<br> Strict Standards: Only variables should be passed by reference in /in/vqhi9 on line 345 register_shutdown_function
Process exited with code 255.