3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fullArtistTimes = [ ['time' => '18:31:00', 'artist' => 'LUIS RODRIGUEZ & DEN HARROW'], ['time' => '18:32:00', 'artist' => 'J BALVIN'], ['time' => '18:33:00', 'artist' => 'THE BLACK EYED PEAS FT J BALVIN'], ['time' => '18:34:00', 'artist' => 'THE BLACK EYED PEAS FT J BALVIN'], ['time' => '18:35:00', 'artist' => 'J BALVIN'] ]; $fullArtist = 'THE BLACK EYED PEAS FT J BALVIN'; $artistDelimiters = '~ (?:[+e,&]|and|f(?:ea)?t\.?|vs\.?) ~i'; $artists = array_flip(preg_split($artistDelimiters, $fullArtist)); $result = []; foreach ($fullArtistTimes as $row) { foreach (preg_split($artistDelimiters, $row['artist']) as $artist) { if (isset($artists[$artist])) { $result[] = "{$artist} is at {$row['time']}"; } } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'J BALVIN is at 18:32:00', 1 => 'THE BLACK EYED PEAS is at 18:33:00', 2 => 'J BALVIN is at 18:33:00', 3 => 'THE BLACK EYED PEAS is at 18:34:00', 4 => 'J BALVIN is at 18:34:00', 5 => 'J BALVIN is at 18:35:00', )

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:
27.28 ms | 406 KiB | 5 Q