kingandy: (Default)
[personal profile] kingandy
One thing I love about php is the ability to go:

$result = mysql_query($query) or die();

The "or" syntax just means, "if this operation returns false, perform this other action" - used mostly for error reporting or whatever.  The "die" function stops processing the page (and, yes, there's usually some useful error message inside those brackets but for the purposes of this post that's not important).

I just really enjoy telling a page to commit seppuku if it fails in its duties.

Date: 2005-09-07 02:02 pm (UTC)
From: [identity profile] stsquad.livejournal.com
A coding idiom inherited from perl. I've probably asked before, but do you grok perl?

Date: 2005-09-07 02:34 pm (UTC)
From: [identity profile] stsquad.livejournal.com
No, its PHP Hypertext Processor

Date: 2005-09-07 02:38 pm (UTC)
From: [identity profile] samharber.livejournal.com
?

PHP stands for PHP Hypertext Processor?

So what does the first PHP stand for?

Date: 2005-09-07 03:00 pm (UTC)
From: [identity profile] stsquad.livejournal.com
Its recursive*.



*see recursive

Date: 2005-09-07 04:07 pm (UTC)
From: [identity profile] stsquad.livejournal.com
Its probably due to recursion being such popular computing algorithm.

Date: 2005-09-07 02:37 pm (UTC)
From: [identity profile] renniek.livejournal.com
PHP always feels to me like a simplified version of Perl, optimised for Web development. The basic syntax is very similar.

Date: 2005-09-07 03:00 pm (UTC)
From: [identity profile] stsquad.livejournal.com
It certainly draws a lot from perl's heratige, including the pcre libraries.

Date: 2005-09-07 06:31 pm (UTC)
From: [identity profile] mirabehn.livejournal.com
I know very little about php (just that [livejournal.com profile] evil_nick is a big fan), but I just wanted to go "yay! yay! yay!" at your choice of music. *grins*

Date: 2005-09-09 04:20 pm (UTC)
From: [identity profile] mj-uk.livejournal.com
didnt perl have a kill function?

March 2012

S M T W T F S
    123
45678910
11121314151617
18192021222324
25 262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 29th, 2025 03:19 pm
Powered by Dreamwidth Studios