3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings[] = "http://t.me/tm_factory_bot"; //0 $strings[] = "https://telegram.me/tm_factory_bot"; //1 $strings[] = "https://telegram.me/tm_factory_bot?start=123"; //2 $strings[] = "tg://resolve?domain=buy_this"; //3 $strings[] = "tg://resolve?domain=buy_this&start=123"; //4 $strings[] = "https://t.me/joinchat/AAAAAEOI5lHxvYlMxwHGSA"; //5 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fjoin%3Finvite%3DAAAAAEOI5lHxvYlMxwH-GSA"; //6 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dbuy_this"; //7 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dtm_factory_bot%26start%3D123"; //8 $strings[] = "https://web.telegram.org/#/im?p=@funny_images"; //9 $strings[] = "@funny_images"; //10 $strings[] = "funny_images"; //11 $strings[] = "tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA"; //12 foreach ($strings as $key=>$string) { $tgType = true; if ($tgType) { $private = "tg://join?invite="; $public = "tg://resolve?domain="; $sep = "&"; } else { $private = "https://t.me/joinchat/"; $public = "https://t.me/"; $sep = "?"; } $value = urldecode($string); preg_match('#[^&\?]??([a-z_0-9\-]+)[&\?]??(start=[a-z0-9]*?)?$#i', $value, $preg); if (preg_match("#(invite=|joinchat/)#i", $value)) { $link = $private . $preg[1]; } else { $link = $public . $preg[1]; } if (isset($preg[2])) { $link .= $sep . $preg[2]; } echo "\r\n" . $key . " - " . $link; }
Output for git.master_jit, git.master, rfc.property-hooks
0 - tg://resolve?domain=tm_factory_bot 1 - tg://resolve?domain=tm_factory_bot 2 - tg://resolve?domain=tm_factory_bot&start=123 3 - tg://resolve?domain=buy_this 4 - tg://resolve?domain=buy_this&start=123 5 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA 6 - tg://join?invite=AAAAAEOI5lHxvYlMxwH-GSA 7 - tg://resolve?domain=buy_this 8 - tg://resolve?domain=tm_factory_bot&start=123 9 - tg://resolve?domain=funny_images 10 - tg://resolve?domain=funny_images 11 - tg://resolve?domain=funny_images 12 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
58.18 ms | 402 KiB | 8 Q