3v4l.org

run code in 300+ PHP versions simultaneously
<?php $proxy = "http://XDGC463:LaposteAphelion!@surf-sccc.pasi.log.intra.laposte.fr:8080"; $regexProxy = '/(?P<scheme>https?):\/\/((?P<username>[^:]+)(:(?P<password>.+))?@)?(?P<url>(?P<host>[a-z0-9\.-]+)(:(?P<port>\d+))?)/'; preg_match($regexProxy, $proxy, $matches); var_dump($matches);
Output for 7.1.0 - 7.1.13, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.4 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.16, 8.3.0 - 8.3.3
array(16) { [0]=> string(72) "http://XDGC463:LaposteAphelion!@surf-sccc.pasi.log.intra.laposte.fr:8080" ["scheme"]=> string(4) "http" [1]=> string(4) "http" [2]=> string(25) "XDGC463:LaposteAphelion!@" ["username"]=> string(7) "XDGC463" [3]=> string(7) "XDGC463" [4]=> string(17) ":LaposteAphelion!" ["password"]=> string(16) "LaposteAphelion!" [5]=> string(16) "LaposteAphelion!" ["url"]=> string(40) "surf-sccc.pasi.log.intra.laposte.fr:8080" [6]=> string(40) "surf-sccc.pasi.log.intra.laposte.fr:8080" ["host"]=> string(35) "surf-sccc.pasi.log.intra.laposte.fr" [7]=> string(35) "surf-sccc.pasi.log.intra.laposte.fr" [8]=> string(5) ":8080" ["port"]=> string(4) "8080" [9]=> string(4) "8080" }

preferences:
116.49 ms | 405 KiB | 148 Q