Meaning of Life

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Meaning of Life

Post by McGruff »

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:

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..';

}
?>
But I kept getting "deity not defined" errors and no output.

Then it hit me:

Code: Select all

<?php

function meaningofLife() {

    $meaning_of_life = 7 * 6;
    return $meaning_of_life;

}
?>
Success! And all in just a few lines of code!

The doctor says I have to go now.
Last edited by McGruff on Thu Aug 11, 2005 9:02 am, edited 1 time in total.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

About your artificial intelligence experience, i had allmost the same.....

Once i had written a program with artificial intelligence like human people have.

When i runed it, it try'ed to find out what programming language it was, after some hour's he discoverd it. Then he was looking for his creator, but without any webcam, mic in or some other communications was any attemt useless. After this, he try'd to caculate the change that he was created random. After 3 years, he found out it's a to big change. So he coudn't exist becouse there was no reason, and deleted himself.

Damm, where are backups when you need them.....
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Re: Meaning of Life

Post by hob_goblin »

McGruff wrote: $meaning_of_life = 7 * 6;

8O *gets his towel*
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

42 is not the meaning of life. It is the answer to the ultimate question.

"The Meaning of Life" is a Monty Python movie.

So there.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

The meaning of life may only be found when life is no longer around
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Try this or, of course, the manual.

I know, it's all too obvious. :roll:
Post Reply