FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » what does mean this?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: what does mean this? [message #175335 is a reply to message #175333] Tue, 06 September 2011 20:59 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(rataplanbumbum)

> In a script I have a statement:
>
> $cartID = $cart->cartID = $cart->generate_cart_id();
>
>
> can someone explain what does this mean?

$cart is an object. Its method generate_cart_id() returns some value,
which is assigned to both the variable $cartID and the object property
$cart->cartID.

A more complex way to code this would be:

$result = $cart->generate_cart_id();
$cart->cartID = $result;
$cartID = $result;

What's ugly about this is that the same value is stored in an object
property and in a variable. Without knowing the context this doesn't
look good.

Micha

--
http://mfesser.de/blickwinkel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php mbstring extension doesnt load
Next Topic: UTF-8 in MSSQL
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 21:53:07 GMT 2024

Total time taken to generate the page: 0.04975 seconds