Another reason to validate input is simply because you can provide more intuative responses to the user.  They may hit a letter by accident while typing in a number.  It is far more clear to the user if you inform them that they've made a mistake and allow them to correct it, rather than have the application break, or worse, have the application continue with an unexpected result.
 
Another reason to validate input is simply because you can provide more intuative responses to the user.  They may hit a letter by accident while typing in a number.  It is far more clear to the user if you inform them that they've made a mistake and allow them to correct it, rather than have the application break, or worse, have the application continue with an unexpected result.
   Exception encountered, of type "Error"
[e5b0433e] /index.php?title=Validation&diff=prev&oldid=481 Error from line 434 of /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(544): DiffEngine->diag(integer, integer, integer, integer, integer)
#1 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq(integer, integer, integer, integer)
#2 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal(array, array)
#3 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(721): DiffEngine->diff(array, array)
#4 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(859): Diff->__construct(array, array)
#5 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DairikiDiff.php(980): MappedDiff->__construct(array, array, array, array)
#6 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct(array, array)
#7 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed(array, array)
#8 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DiffFormatter.php(82): DiffFormatter->block(integer, integer, integer, integer, array)
#9 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(888): DiffFormatter->format(Diff)
#10 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(802): DifferenceEngine->generateTextDiffBody(string, string)
#11 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(733): DifferenceEngine->generateContentDiffBody(WikitextContent, WikitextContent)
#12 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff(string, string, string)
#14 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff(string, string, string)
#15 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/page/Article.php(795): DifferenceEngine->showDiffPage(boolean)
#16 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/page/Article.php(506): Article->showDiffPage()
#17 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/actions/ViewAction.php(44): Article->view()
#18 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/MediaWiki.php(395): ViewAction->show()
#19 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/MediaWiki.php(273): MediaWiki->performAction(Article, Title)
#20 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/MediaWiki.php(566): MediaWiki->performRequest()
#21 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/includes/MediaWiki.php(414): MediaWiki->main()
#22 /misc/21/000/105/835/1/user/web/wiki.hashphp.org/index.php(41): MediaWiki->run()
#23 {main}