3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "days=Mon&days=Wed" . "&fruit[1]=Apple&fruit[]=Banana&amp;age=13"; parse_str($str, $output); // gettype will return 'array' or 'string' echo gettype($output['days']); echo ' - '; // array_search will return the key // where the first argument is located echo array_search('Banana', $output['fruit']); echo ' - '; echo array_key_exists('age', $output) ? $output['age'] : 0; ?>
Output for git.master, git.master_jit, rfc.property-hooks
string - 2 - 0

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