Need a quick explination on $this = $that = $theotherthing = array ();

Posted on 2009-04-23
Last Modified: 2012-05-06
Been seeing something recently that I'm not quite clear on.  Could someone give me a quick explanation or link to where I can find out.. What is the code snippet doing and how might it be usefully?  I guess I'm just wondering how they all relate.

$this = $that = $theotherthing = array ();


Open in new window

Question by:graphxdiva
    LVL 18

    Expert Comment

    That code would be the same as:

    $theotherthing = array();
    $that = $theotherthing;
    $this = $that;

    Just on a single line.

    Author Comment

    Ok so just a quick version of..

    $this = array();
    $that = array();
    $theotherthing = array();

    in this case.  Thats what I figured but wasn't sure if it was building some kind of associative array.
    LVL 18

    Accepted Solution

    Yup, you it. It could be useful if you want several variables to start with the same value. Minimalist coding...

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now