3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emails = array( 'mail1@gmail.com', 'mail2@gmail.com', 'mail3@gmail.com', 'mail4@gmail.com', 'mail5@gmail.com', 'mail1@yahoo.com', 'mail2@yahoo.com', 'mail3@yahoo.com', 'mail4@yahoo.com', 'mail5@yahoo.com', 'mail1@aol.com', 'mail2@aol.com', 'mail3@aol.com', 'mail4@aol.com', 'mail5@aol.com', 'mail1@others.com', 'mail2@others.com', 'mail3@others.com', 'mail4@others.com', 'mail5@others.com', ); $organized_emails = array(); $needle_key = 0; $needle_search = array('gmail', 'yahoo', 'aol', 'others'); while(true) { $current_value = array_shift($emails); if(strpos($current_value, $needle_search[$needle_key]) !== false) { $organized_emails[] = $current_value; $needle_key++; if($needle_key > 3) { $needle_key = 0; } } else { array_push($emails, $current_value); } if(empty($emails)) { break; } } echo '<pre>'; print_r($organized_emails); echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => mail1@gmail.com [1] => mail1@yahoo.com [2] => mail1@aol.com [3] => mail1@others.com [4] => mail2@gmail.com [5] => mail2@yahoo.com [6] => mail2@aol.com [7] => mail2@others.com [8] => mail3@gmail.com [9] => mail3@yahoo.com [10] => mail3@aol.com [11] => mail3@others.com [12] => mail4@gmail.com [13] => mail4@yahoo.com [14] => mail4@aol.com [15] => mail4@others.com [16] => mail5@gmail.com [17] => mail5@yahoo.com [18] => mail5@aol.com [19] => mail5@others.com ) </pre>

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:
42.35 ms | 402 KiB | 8 Q