3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MultiImageComponent { public $imgs = []; public function __construct() { foreach(func_get_args() as $url) { $this->imgs[] = new Image($url); } } public function getUrls() { $urls = []; foreach($this->imgs as $img) { $urls[] = $img->getUrl(); } return $urls; } } class Image { private $url = ''; public function __construct($url) { $this->url = $url; } public function getUrl() { return $this->url; } } $mic = new MultiImageComponent("https://photos.smugmug.com/Comics/Pa-comics/n-xmQS5/i-RZcDzzK/0/2100x20000/i-RZcDzzK-2100x20000.jpg", "http://www.acq-inc.com/assets/ai/img/img_staff.gif", "https://a.fsdn.com/sd/topics/business_64.png"); var_dump($mic->getUrls());
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(99) "https://photos.smugmug.com/Comics/Pa-comics/n-xmQS5/i-RZcDzzK/0/2100x20000/i-RZcDzzK-2100x20000.jpg" [1]=> string(50) "http://www.acq-inc.com/assets/ai/img/img_staff.gif" [2]=> string(44) "https://a.fsdn.com/sd/topics/business_64.png" }

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:
57.26 ms | 401 KiB | 8 Q