3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "client_id address address_2 city street phone phone_2 mobile mobile_2 email_2 web_address web_address_2 sex_id sex_orientation_id date_of_birth ancestry_id country_id height PRIMARY weight figure_id breast_size_id eye_color_id hair_color_id has_tattoo has_piercings body_hair_id intimate_id is_smoker is_alcoholic canton_id zip_code local_id first_name last_name text nickname"; $a = explode("\n", $s); $b = []; foreach($a as $key=>$temp) { if (strpos($temp, 'id') !== false) { $b[$temp] = [ 'valid' => 'int', 'label' => ucfirst(str_replace('_', ' ', $temp))]; } else { $b[$temp] = [ 'valid' => 'min(1)', 'label' => ucfirst(str_replace('_', ' ', $temp))]; } } echo $a;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/a5Wnq on line 49 Array

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