3v4l.org

run code in 300+ PHP versions simultaneously
<?php $domains = array( 'http://wwwvagrant.royalmail.com/business', 'http://wwwvagrant.parcelforce.com', 'https://www2.postoffice.co.uk', 'http://wwwvagrant.royalmail.com', 'asdfasdfasdf', 'http://eibvagrant.royalmail.com', 'http://wwwvagrant.royalmail.com/payments', ); $doamins = filter_var_array($domains, FILTER_VALIDATE_URL); print_r($domains); var_dump( filter_var('dsd', FILTER_VALIDATE_UR));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Array ( [0] => http://wwwvagrant.royalmail.com/business [1] => http://wwwvagrant.parcelforce.com [2] => https://www2.postoffice.co.uk [3] => http://wwwvagrant.royalmail.com [4] => asdfasdfasdf [5] => http://eibvagrant.royalmail.com [6] => http://wwwvagrant.royalmail.com/payments ) Fatal error: Uncaught Error: Undefined constant "FILTER_VALIDATE_UR" in /in/dU7CO:14 Stack trace: #0 {main} thrown in /in/dU7CO on line 14
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Array ( [0] => http://wwwvagrant.royalmail.com/business [1] => http://wwwvagrant.parcelforce.com [2] => https://www2.postoffice.co.uk [3] => http://wwwvagrant.royalmail.com [4] => asdfasdfasdf [5] => http://eibvagrant.royalmail.com [6] => http://wwwvagrant.royalmail.com/payments ) Warning: Use of undefined constant FILTER_VALIDATE_UR - assumed 'FILTER_VALIDATE_UR' (this will throw an Error in a future version of PHP) in /in/dU7CO on line 14 Warning: filter_var() expects parameter 2 to be int, string given in /in/dU7CO on line 14 NULL
Output for 7.2.0 - 7.2.33
Array ( [0] => http://wwwvagrant.royalmail.com/business [1] => http://wwwvagrant.parcelforce.com [2] => https://www2.postoffice.co.uk [3] => http://wwwvagrant.royalmail.com [4] => asdfasdfasdf [5] => http://eibvagrant.royalmail.com [6] => http://wwwvagrant.royalmail.com/payments ) Warning: Use of undefined constant FILTER_VALIDATE_UR - assumed 'FILTER_VALIDATE_UR' (this will throw an Error in a future version of PHP) in /in/dU7CO on line 14 Warning: filter_var() expects parameter 2 to be integer, string given in /in/dU7CO on line 14 NULL
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Array ( [0] => http://wwwvagrant.royalmail.com/business [1] => http://wwwvagrant.parcelforce.com [2] => https://www2.postoffice.co.uk [3] => http://wwwvagrant.royalmail.com [4] => asdfasdfasdf [5] => http://eibvagrant.royalmail.com [6] => http://wwwvagrant.royalmail.com/payments ) Notice: Use of undefined constant FILTER_VALIDATE_UR - assumed 'FILTER_VALIDATE_UR' in /in/dU7CO on line 14 Warning: filter_var() expects parameter 2 to be integer, string given in /in/dU7CO on line 14 NULL
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Array ( [0] => http://wwwvagrant.royalmail.com/business [1] => http://wwwvagrant.parcelforce.com [2] => https://www2.postoffice.co.uk [3] => http://wwwvagrant.royalmail.com [4] => asdfasdfasdf [5] => http://eibvagrant.royalmail.com [6] => http://wwwvagrant.royalmail.com/payments ) Notice: Use of undefined constant FILTER_VALIDATE_UR - assumed 'FILTER_VALIDATE_UR' in /in/dU7CO on line 14 Warning: filter_var() expects parameter 2 to be long, string given in /in/dU7CO on line 14 NULL

preferences:
202.35 ms | 403 KiB | 229 Q