Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3088

Re: what does mean this?

From Michael Fesser <netizen@gmx.de>
Newsgroups comp.lang.php
Subject Re: what does mean this?
Date 2011-09-06 22:59 +0200
Message-ID <up1d67t0973bdmlmne3fml018fararr39k@mfesser.de> (permalink)
References <4e668493$0$15662$4fafbaef@reader2.news.tin.it>

Show all headers | View raw


.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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

what does mean this? rataplanbumbum <rataplanbumbum> - 2011-09-06 22:37 +0200
  Re: what does mean this? Jerry Stuckle <jstucklex@attglobal.net> - 2011-09-06 16:54 -0400
  Re: what does mean this? Michael Fesser <netizen@gmx.de> - 2011-09-06 22:59 +0200
    Re: what does mean this? rataplanbumbum <rataplanbumbum> - 2011-09-07 14:07 +0200
      Re: what does mean this? sheldonlg <sheldonlg@thevillages.net> - 2011-09-07 10:37 -0400

csiph-web