Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

oop programming with eclipse

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

oop programming with eclipse

Postby greenboy663 » Tue Jan 28, 2014 4:14 am

please consider the following code:

Code: Select all
class MySampleClass
{
    public $Prop1 = 'value1';
    Public $Prop2 = 'value2';
}

function Get_Item()
{
    $item = new MySampleClass();
    return $item;
}

function Get_Items()
{
    $items = array();   
    for($i=0;$i<12;$i++)
    {
        $item = new MySampleClass();
        $items[] = $item;
    }   
    return $items;
}


$mainItem = Get_Item();
echo $mainItem->Prop2;//{first fetch}

$mainItems = Get_Items();
foreach ($mainItems as $item)
{
    echo $item->???;//{second fetch}
}



In {firtst fetch} eclipse suggest list of class property but in {second fetch} There are not any suggestion!!!
I pass collection with array, is this problem? i must change my code style? or my IDE?
greenboy663
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Jan 28, 2014 4:00 am

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.