3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate($input) { $count = 0; foreach ($input as $value) if (!empty($value)) $count++; return $count < 3 ? $count * 8.5 : 20; } // VOORBEELD 1: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = 'JA'; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = 'JA'; $_SESSION['input']['4'] = ''; $_SESSION['input']['5'] = ''; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 1: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\n"; // VOORBEELD 2: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = 'NEE'; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = 'JA'; $_SESSION['input']['4'] = 'JA'; $_SESSION['input']['5'] = 'NEE'; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 2: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\n"; // VOORBEELD 3: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = ''; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = ''; $_SESSION['input']['4'] = ''; $_SESSION['input']['5'] = ''; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 3: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\n"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Voorbeeld 1: het bedrag is: 17,00 euro. Voorbeeld 2: het bedrag is: 20,00 euro. Voorbeeld 3: het bedrag is: 0,00 euro.

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:
30.03 ms | 405 KiB | 5 Q