While reading and writing PHP, i've seen a (cast_required)thing within PHP 'literature', which i also use, but i don't know what it is.
Par example:
mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
Ok, the basics are easy: connect to mysql, and if anything fails, just kill the execution of the script and print the mysql_error() message to the user. This is a common occurrence in PHP all around.
Buuuut:
What is the 'or' thing, apart from its obvious meaning? It's not a function, not an operator, not a bullet, neither a train, nor Superman.
How does it do that which it does? I've never seen it in any context other than mysql error handling. Is it a primitive try/catch clause? Language construct? How else can it be used?
Thanks!


Sign In
Create Account


Back to top









