From my original comment:
The most likely explanation as far as I can see is that your command-line is running a different version of PHP to your web server. Try running php -v at the commandline to confirm that it's running the version you expect.
OP's response
@Spudley, thank you for your feedback. Seems like you're the only one actually reading my post and not making assumptions. As you said, I ran "php -v" and here's what I get, so it's apparent I'm running an earlier version of PHP: PHP 4.4.9 (cgi-fcgi) (built: Jul 22 2013 09:48:43) Copyright (c) 1997-2008 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
So there we go, that's clearly the problem. You've got PHP 4.4 on there. That needs to go.
Solution get rid of the old busted version of PHP, and make sure your command line php is running the same version as your web server.
You haven't specified what operating system you're running, which will obviously make big a difference to how you do the un-install.
If you can find the old PHP version in your un-install tool, do it and hopefully you'll start picking up the newer PHP version by magic. If not, then depending on how things are configured you may find that the easiest wat to achieve this is to un-install both PHP versions, and then re-install the 5.4 version.