3v4l.org

run code in 150+ 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 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
float(17)