3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(7, 15, 17, 21); $suma = 0; foreach ($a as $digit) { $suma = $suma + digit; } echo $suma;
based on ahgAu
Output for 7.2.0
Warning: Use of undefined constant digit - assumed 'digit' (this will throw an Error in a future version of PHP) in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Warning: Use of undefined constant digit - assumed 'digit' (this will throw an Error in a future version of PHP) in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Warning: Use of undefined constant digit - assumed 'digit' (this will throw an Error in a future version of PHP) in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Warning: Use of undefined constant digit - assumed 'digit' (this will throw an Error in a future version of PHP) in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 0
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Warning: A non-numeric value encountered in /in/PeK2N on line 7 0
Output for 5.3.21 - 7.0.20
Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 Notice: Use of undefined constant digit - assumed 'digit' in /in/PeK2N on line 7 0