3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Testdata $_SESSION['input']['1'] = ''; $_SESSION['input']['2'] = 'JA'; $_SESSION['input']['3'] = null; $_SESSION['input']['4'] = ''; $_SESSION['input']['5'] = 'JA'; $_SESSION['input']['6'] = ''; // Aantal ingevulde inputs tellen $telling = count(array_filter($_SESSION['input'])); // Bedrag bepalen $bedrag = $telling < 3 ? $telling * 8.5 : 20; // Voilá var_dump($bedrag); ?>
Output for 4.3.0 - 7.1.7
float(17)