3v4l.org

run code in 300+ PHP versions simultaneously
<?php function expandShortUrl($shortUrl) { $ch = curl_init($shortUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $expandedUrl = curl_exec($ch); curl_close($ch); return $expandedUrl; } function expandShortUrls($shortUrls) { $expandedUrls = array(); foreach ($shortUrls as $shortUrl) { $expandedUrl = expandShortUrl($shortUrl); $expandedUrls[] = $expandedUrl; } return $expandedUrls; } // Kısa linkler $shortUrls = array( "https://www.etsy.com/listing/664135699", "https://www.etsy.com/listing/612721265", "https://www.etsy.com/listing/596197569", "https://www.etsy.com/listing/576635976", "https://www.etsy.com/listing/466790858", "https://www.etsy.com/listing/249127718", "https://www.etsy.com/listing/232208668", "https://www.etsy.com/listing/1741336387", "https://www.etsy.com/listing/1680069076", "https://www.etsy.com/listing/1659620413" ); // Kısa linkleri genişlet $expandedUrls = expandShortUrls($shortUrls); // Genişletilmiş linkleri yazdır foreach ($expandedUrls as $index => $expandedUrl) { echo ($index + 1) . ". " . $expandedUrl . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/mTS8v:4 Stack trace: #0 /in/mTS8v(15): expandShortUrl('https://www.ets...') #1 /in/mTS8v(36): expandShortUrls(Array) #2 {main} thrown in /in/mTS8v on line 4
Process exited with code 255.

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:
32.28 ms | 405 KiB | 5 Q