Meaning of Life
Posted: Sun May 18, 2003 8:52 pm
Php is pretty capable but can it work out the meaning of life?
I started off writing a complex class to parse religious texts, great works of literature, and transcripts of the Jerry Springer show but it started showing signs of its own artificial intelligence and argued constantly so I had to delete it.
So then I tried:
But I kept getting "deity not defined" errors and no output.
Then it hit me:
Success! And all in just a few lines of code!
The doctor says I have to go now.
I started off writing a complex class to parse religious texts, great works of literature, and transcripts of the Jerry Springer show but it started showing signs of its own artificial intelligence and argued constantly so I had to delete it.
So then I tried:
Code: Select all
<?php
function askGod() {
echo 'What is the meaning of life, God?';
echo 'Hello? Is anybody listening?';
echo 'Look I haven''t got all day you know..';
}
?>Then it hit me:
Code: Select all
<?php
function meaningofLife() {
$meaning_of_life = 7 * 6;
return $meaning_of_life;
}
?>The doctor says I have to go now.