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 'Het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.'; // 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 'Het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Het bedrag is: 17,00 euro.Het bedrag is: 20,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:
40.04 ms | 401 KiB | 8 Q