3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url=""; $url = iconv(/*in*/"cp1251", /*out*/"UTF-8", $url); if (preg_match('/^(?:(?:https?):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i', $url)) { } preg_match( "/[^\x{00a0}-\x{FFFF}\x]+/u" , '۱۲۳۴۵۶۷۸۹۰' );
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: iconv(): Wrong encoding, conversion from "cp1251" to "UTF-8" is not allowed in /in/uIv8B on line 3 Warning: preg_match(): Compilation failed: character code point value in \x{} or \o{} is too large at offset 329 in /in/uIv8B on line 4
Output for 7.3.32 - 7.3.33, 7.4.33, 8.0.13
Fatal error: Uncaught Error: Call to undefined function iconv() in /in/uIv8B:3 Stack trace: #0 {main} thrown in /in/uIv8B on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.12
Warning: preg_match(): Compilation failed: character code point value in \x{} or \o{} is too large at offset 329 in /in/uIv8B on line 4
Output for 7.4.26 - 7.4.32
Notice: iconv(): Wrong charset, conversion from `cp1251' to `UTF-8' is not allowed in /in/uIv8B on line 3 Warning: preg_match(): Compilation failed: range out of order in character class at offset 323 in /in/uIv8B on line 4
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.25
Warning: preg_match(): Compilation failed: range out of order in character class at offset 323 in /in/uIv8B on line 4
Output for 5.5.10 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: preg_match(): Compilation failed: character value in \x{} or \o{} is too large at offset 329 in /in/uIv8B on line 4
Output for 5.5.0 - 5.5.9
Warning: preg_match(): Compilation failed: character value in \x{...} sequence is too large at offset 329 in /in/uIv8B on line 4

preferences:
242.37 ms | 401 KiB | 331 Q