3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "Enter marks for subject 1 : "; fscanf(STDIN, "%d\n", $m1); echo "Enter marks for subject 2 : "; fscanf(STDIN, "%d\n", $m2); echo "Enter marks for subject 3 : "; fscanf(STDIN, "%d\n", $m3); $tot=$m1+$m2+$m3; $avg=$tot/3; print($tot); print($avg); ?>
based on MtrZG
Output for 5.2.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Enter marks for subject 1 : Enter marks for subject 2 : Enter marks for subject 3 : 00
Output for 4.3.0 - 5.2.2
Enter marks for subject 1 : Notice: Use of undefined constant STDIN - assumed 'STDIN' in /in/QG8Ys on line 3 Warning: fscanf(): supplied argument is not a valid File-Handle resource in /in/QG8Ys on line 3 Enter marks for subject 2 : Notice: Use of undefined constant STDIN - assumed 'STDIN' in /in/QG8Ys on line 5 Warning: fscanf(): supplied argument is not a valid File-Handle resource in /in/QG8Ys on line 5 Enter marks for subject 3 : Notice: Use of undefined constant STDIN - assumed 'STDIN' in /in/QG8Ys on line 7 Warning: fscanf(): supplied argument is not a valid File-Handle resource in /in/QG8Ys on line 7 00