3v4l.org

run code in 300+ PHP versions simultaneously
<?php // THIS IS SYNC CODE /** Make the calls **/ foreach ($callsToMake as $serverClients) { foreach ($serverClients as $keys) { /** @var ConnectionConfig $clientConfig */ $clientConfig = $keys['config']; /** Transport returns json **/ $transport = $this->transportFactory->build($this->client, $this->request, $clientConfig); /** Adapter returns Torrent objects **/ $adapter = $this->adapterFactory->build($transport); $torrents = array_merge($torrents, $adapter->getTorrents($keys['hashes'])); } } return $torrents; // TRYING TO MAKE IT ASYNC WITH $callable /** Make the calls **/ foreach ($callsToMake as $serverClients) { foreach ($serverClients as $keys) { /** @var ConnectionConfig $clientConfig */ $clientConfig = $keys['config']; /** Transport returns json **/ $transport = $this->transportFactory->build($this->client, $this->request, $clientConfig, $async = true); /** Adapter returns Torrent objects **/ $adapter = $this->adapterFactory->build($transport); $torrents = array_merge($torrents, $adapter->getTorrents($keys['hashes'], $callable)); // Obviously, this will only happen once } }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $callsToMake in /in/iq4P8 on line 6 Warning: foreach() argument must be of type array|object, null given in /in/iq4P8 on line 6 Warning: Undefined variable $torrents in /in/iq4P8 on line 23

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