Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Object without class

0 views
Skip to first unread message

Cpt. Zeep

unread,
Jan 4, 2004, 5:14:38 AM1/4/04
to
Hello all!

I have a question regarding next few lines of code.

<?php
$person->name = "John Doe";
$person->age = "26";
?>

What does this piece of code actually do? It seems to create object $person,
but i am not shure if i can create objects without defining class first? I'm
little confused here :) This reminds me of structures in C...
Thanx!

--
Relaxen und watch das blinkenlights...


CountScubula

unread,
Jan 4, 2004, 5:39:17 AM1/4/04
to
"Cpt. Zeep" <ze...@nemame.com> wrote in message
news:bt8p8v$cvn$1...@bagan.srce.hr...

nothing more than an empty object with variables in it, 2 in this case

php is realy nice about auto.... (I forget the word) Basicaly, when you
first use something, it will be created for you right then. This is one
major differnce from a script language and a compiled one. dont get me
wrong, you can do this in a high level language, however for really tight
code compiling. say for a microchip, you do not want the overhead of
auto-defining. you simple state how big a varaible is going to be, so it
makes room for it.


--
Mike Bradley
http://gzen.myhq.info -- free online php tools


Jochen Buennagel

unread,
Jan 4, 2004, 5:46:47 AM1/4/04
to
Cpt. Zeep wrote:
> <?php
> $person->name = "John Doe";
> $person->age = "26";
> ?>
>
> What does this piece of code actually do? It seems to create object $person,
> but i am not shure if i can create objects without defining class first?

try <?php echo get_class($person); ?>

It will output "stdClass" which is the pseudo-class PHP uses for
uninitialized objects.

Jochen

TG

unread,
Jan 4, 2004, 2:01:54 PM1/4/04
to
CountScubula if you are the one who runs the gzentools.com site, your e-mail
address of in...@gzentools.com is bouncing, I am getting a message that says
relaying denied. I sent you an email that bounces with this error message,
how can I contact that site?

"CountScubula" <m...@scantek.hotmail.com> wrote in message
news:p3SJb.5906$CI3...@newssvr29.news.prodigy.com...

CountScubula

unread,
Jan 4, 2004, 4:52:28 PM1/4/04
to
"TG" <tgill...@cox.net> wrote in message
news:xBXJb.23058$JD6.795@lakeread04...

> CountScubula if you are the one who runs the gzentools.com site, your
e-mail
> address of in...@gzentools.com is bouncing, I am getting a message that
says
> relaying denied. I sent you an email that bounces with this error message,
> how can I contact that site?
>

I need to stop configuring stuff when I am sleep deprieved, I needed to
restart sendmail, it did not notice the new entry in local-host-names.

thanks for the info, it is working now.

Cpt. Zeep

unread,
Jan 5, 2004, 4:32:39 AM1/5/04
to
Thanx everybody!

Chung Leong

unread,
Jan 5, 2004, 7:01:12 PM1/5/04
to
The term you're looking for is "autovivication." Ok, I had to look it up in
my camel book.

Uzytkownik "CountScubula" <m...@scantek.hotmail.com> napisal w wiadomosci
news:p3SJb.5906$CI3...@newssvr29.news.prodigy.com...

0 new messages