3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urls = array( 'http://www.website.com/path1/path2/file1.php?query1=true&query2=false', 'http://website.com/path1/path2/file1.php?query1=true&query2=false', 'http://website/path1/path2/file1.php?query1=true&query2=false', 'http://www.website.com/path1/path2/?query1=true&query2=false', 'http://website.com/path1/path2/?query1=true&query2=false', 'http://website/path1/path2/?query1=true&query2=false', 'http://www.website.com/path1/path2/', 'http://website.com/path1/path2/', 'http://website/path1/path2/', 'http://www.website.com?query1=true&query2=false', 'http://website.com?query1=true&query2=false', 'http://website?query1=true&query2=false', 'www.website.com/path1/path2/file1.php?query1=true&query2=false', 'website.com/path1/path2/file1.php?query1=true&query2=false', 'website/path1/path2/file1.php?query1=true&query2=false', 'www.website.com/path1/path2/?query1=true&query2=false', 'website.com/path1/path2/?query1=true&query2=false', 'website/path1/path2/?query1=true&query2=false', 'www.website.com/path1/path2/', 'website.com/path1/path2/', 'website/path1/path2/', 'www.website.com?query1=true&query2=false', 'website.com?query1=true&query2=false', 'website?query1=true&query2=false', ); $flags = array( null, FILTER_FLAG_SCHEME_REQUIRED, FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED, FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED, FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED & FILTER_FLAG_QUERY_REQUIRED ); foreach($urls as $url){ foreach($flags as $flag){ echo "$url:\r\n"; var_dump((bool) filter_var($url, FILTER_VALIDATE_URL, $flag)); } echo "\r\n"; }
Output for 5.2.1 - 7.1.0
http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/: bool(false) www.website.com/path1/path2/: bool(false) www.website.com/path1/path2/: bool(false) www.website.com/path1/path2/: bool(false) www.website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(false) website/path1/path2/: bool(false) website/path1/path2/: bool(false) website/path1/path2/: bool(false) website/path1/path2/: bool(false) website/path1/path2/: bool(false) www.website.com?query1=true&query2=false: bool(false) www.website.com?query1=true&query2=false: bool(false) www.website.com?query1=true&query2=false: bool(false) www.website.com?query1=true&query2=false: bool(false) www.website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(false)
Output for 5.2.0
http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://website/path1/path2/file1.php?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website.com/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://website/path1/path2/?query1=true&query2=false: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://www.website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website.com/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://website/path1/path2/: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://www.website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website.com?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) http://website?query1=true&query2=false: bool(true) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) www.website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) website.com/path1/path2/file1.php?query1=true&query2=false: bool(false) website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) website.com/path1/path2/file1.php?query1=true&query2=false: bool(true) website/path1/path2/file1.php?query1=true&query2=false: bool(true) website/path1/path2/file1.php?query1=true&query2=false: bool(false) website/path1/path2/file1.php?query1=true&query2=false: bool(true) website/path1/path2/file1.php?query1=true&query2=false: bool(true) website/path1/path2/file1.php?query1=true&query2=false: bool(true) www.website.com/path1/path2/?query1=true&query2=false: bool(true) www.website.com/path1/path2/?query1=true&query2=false: bool(false) www.website.com/path1/path2/?query1=true&query2=false: bool(true) www.website.com/path1/path2/?query1=true&query2=false: bool(true) www.website.com/path1/path2/?query1=true&query2=false: bool(true) website.com/path1/path2/?query1=true&query2=false: bool(true) website.com/path1/path2/?query1=true&query2=false: bool(false) website.com/path1/path2/?query1=true&query2=false: bool(true) website.com/path1/path2/?query1=true&query2=false: bool(true) website.com/path1/path2/?query1=true&query2=false: bool(true) website/path1/path2/?query1=true&query2=false: bool(true) website/path1/path2/?query1=true&query2=false: bool(false) website/path1/path2/?query1=true&query2=false: bool(true) website/path1/path2/?query1=true&query2=false: bool(true) website/path1/path2/?query1=true&query2=false: bool(true) www.website.com/path1/path2/: bool(true) www.website.com/path1/path2/: bool(false) www.website.com/path1/path2/: bool(true) www.website.com/path1/path2/: bool(true) www.website.com/path1/path2/: bool(true) website.com/path1/path2/: bool(true) website.com/path1/path2/: bool(false) website.com/path1/path2/: bool(true) website.com/path1/path2/: bool(true) website.com/path1/path2/: bool(true) website/path1/path2/: bool(true) website/path1/path2/: bool(false) website/path1/path2/: bool(true) website/path1/path2/: bool(true) website/path1/path2/: bool(true) www.website.com?query1=true&query2=false: bool(true) www.website.com?query1=true&query2=false: bool(false) www.website.com?query1=true&query2=false: bool(true) www.website.com?query1=true&query2=false: bool(true) www.website.com?query1=true&query2=false: bool(true) website.com?query1=true&query2=false: bool(true) website.com?query1=true&query2=false: bool(false) website.com?query1=true&query2=false: bool(true) website.com?query1=true&query2=false: bool(true) website.com?query1=true&query2=false: bool(true) website?query1=true&query2=false: bool(true) website?query1=true&query2=false: bool(false) website?query1=true&query2=false: bool(true) website?query1=true&query2=false: bool(true) website?query1=true&query2=false: bool(true)
Output for 5.0.0 - 5.1.6
Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 31 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_QUERY_REQUIRED - assumed 'FILTER_FLAG_QUERY_REQUIRED' in /in/L5suP on line 35 http://www.website.com/path1/path2/file1.php?query1=true&query2=false: Fatal error: Call to undefined function filter_var() in /in/L5suP on line 40
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 31 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_QUERY_REQUIRED - assumed 'FILTER_FLAG_QUERY_REQUIRED' in /in/L5suP on line 35 http://www.website.com/path1/path2/file1.php?query1=true&query2=false: Fatal error: Call to undefined function: filter_var() in /in/L5suP on line 40
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 31 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_QUERY_REQUIRED - assumed 'FILTER_FLAG_QUERY_REQUIRED' in /in/L5suP on line 35 http://www.website.com/path1/path2/file1.php?query1=true&query2=false: Fatal error: Call to undefined function: filter_var() in /in/L5suP on line 40
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 31 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 32 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 33 Notice: Use of undefined constant FILTER_FLAG_SCHEME_REQUIRED - assumed 'FILTER_FLAG_SCHEME_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_HOST_REQUIRED - assumed 'FILTER_FLAG_HOST_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_PATH_REQUIRED - assumed 'FILTER_FLAG_PATH_REQUIRED' in /in/L5suP on line 34 Notice: Use of undefined constant FILTER_FLAG_QUERY_REQUIRED - assumed 'FILTER_FLAG_QUERY_REQUIRED' in /in/L5suP on line 35 http://www.website.com/path1/path2/file1.php?query1=true&query2=false: Fatal error: Call to undefined function: filter_var() in /in/L5suP on line 40