Syntax Oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anybody have a rational explanation for what purpose in life the
following syntax is considered acceptable?

<?php
  $query = "UPDATE whatever SET x = 1";
  $query;
?>

Note that the line with just $query; on it doesn't, like, "do" anything.

I suppose in a Zen-like sort of way, it "exists" and all, but, really,
what's the point?

Is there some subtle reason for this not being some kind of syntax
error that's way over my head or something?

This is not just philosophical minutiae -- Real-world beginners, with
no programming experience, actually type the above (albeit with a lot
more logic and whatnot in between) and then wonder why the query
didn't execute.

It even makes a wild sort of sense to type that, if you presume that a
beginner might not grasp the distinctions between PHP and MySQL and
the relationship yet.

Does anybody actually USE this idiom in any meaningful way?
<?php
  "string";
?>

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux