<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Комментарии: SPL в  PHP: ArrayObject</title>
	<atom:link href="http://amdy.su/spl-in-php-arrayobject/feed/" rel="self" type="application/rss+xml" />
	<link>http://amdy.su/spl-in-php-arrayobject/</link>
	<description>Нетривиальный кодинг</description>
	<lastBuildDate>Sun, 15 Jan 2012 21:10:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>Автор: paranoid</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-2739</link>
		<dc:creator>paranoid</dc:creator>
		<pubDate>Thu, 10 Mar 2011 10:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-2739</guid>
		<description>100500 примеров из JS</description>
		<content:encoded><![CDATA[<p>100500 примеров из JS</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: x-yuri</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-1206</link>
		<dc:creator>x-yuri</dc:creator>
		<pubDate>Wed, 18 Aug 2010 08:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-1206</guid>
		<description>хм, случайно наткнулся на твой блог (:

а почему не так, раз уж ты ничего в поведении не меняешь?
class Amdy_Array extends ArrayObject {
    public function __construct( ... ) {
        // получаем откуда-то массив
        parent::__construct( $array );
    }

    ...
}</description>
		<content:encoded><![CDATA[<p>хм, случайно наткнулся на твой блог (:</p>
<p>а почему не так, раз уж ты ничего в поведении не меняешь?<br />
class Amdy_Array extends ArrayObject {<br />
    public function __construct( &#8230; ) {<br />
        // получаем откуда-то массив<br />
        parent::__construct( $array );<br />
    }</p>
<p>    &#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: MasKarAl</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-1121</link>
		<dc:creator>MasKarAl</dc:creator>
		<pubDate>Sun, 09 May 2010 14:50:41 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-1121</guid>
		<description>Когда, например, получаешь строку из БД как объект, и обращаешься к нему, как к массиву.</description>
		<content:encoded><![CDATA[<p>Когда, например, получаешь строку из БД как объект, и обращаешься к нему, как к массиву.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: kelvin</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-846</link>
		<dc:creator>kelvin</dc:creator>
		<pubDate>Sat, 30 Jan 2010 22:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-846</guid>
		<description>можешь назвать пару примеров, когда пригодится обращаться к объекту как к массиву?</description>
		<content:encoded><![CDATA[<p>можешь назвать пару примеров, когда пригодится обращаться к объекту как к массиву?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: admin</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-802</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 11 Jan 2010 11:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-802</guid>
		<description>спасибо огромное, поправил эти и ещё парочку, как же тяжело было без проверки орфографии в opera, да ещё с моей грамотностью :(</description>
		<content:encoded><![CDATA[<p>спасибо огромное, поправил эти и ещё парочку, как же тяжело было без проверки орфографии в opera, да ещё с моей грамотностью <img src='http://amdy.su/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: sartas</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-798</link>
		<dc:creator>sartas</dc:creator>
		<pubDate>Thu, 07 Jan 2010 20:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-798</guid>
		<description>Включил мозг и разобрался :)

Опечатки: особо ноРмальных статей об SPL на русском я не обноружиЛ

Жду новых статей об SPL.</description>
		<content:encoded><![CDATA[<p>Включил мозг и разобрался <img src='http://amdy.su/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Опечатки: особо ноРмальных статей об SPL на русском я не обноружиЛ</p>
<p>Жду новых статей об SPL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: sartas</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-797</link>
		<dc:creator>sartas</dc:creator>
		<pubDate>Thu, 07 Jan 2010 19:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-797</guid>
		<description>Не могу понять в чем различие между

class  Amdy_Array Implements ArrayAccess 

и

class Amdy_Array extends ArrayObject</description>
		<content:encoded><![CDATA[<p>Не могу понять в чем различие между</p>
<p>class  Amdy_Array Implements ArrayAccess </p>
<p>и</p>
<p>class Amdy_Array extends ArrayObject</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: AmdY</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-317</link>
		<dc:creator>AmdY</dc:creator>
		<pubDate>Tue, 31 Mar 2009 16:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-317</guid>
		<description>Согласен, рекурсивный конструктор выглядит лучше, а вот об интерфейсе итератора статья уже в разработке, правда, с декабря :(. 
В __toString(), наверное, лучше бросать exception или уже делать implode</description>
		<content:encoded><![CDATA[<p>Согласен, рекурсивный конструктор выглядит лучше, а вот об интерфейсе итератора статья уже в разработке, правда, с декабря <img src='http://amdy.su/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .<br />
В __toString(), наверное, лучше бросать exception или уже делать implode</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Aivee</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-316</link>
		<dc:creator>Aivee</dc:creator>
		<pubDate>Tue, 31 Mar 2009 15:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-316</guid>
		<description>class MyArrayObject extends ArrayObject
{
    protected $array = array();
    
    public function __construct($array = array())
    {
        foreach ((array) $array as $key =&gt; $value)
        {
            if (is_array($value))
            {
                $this-&gt;array[$key] = new self($value);
            }
            else
            {
                $this-&gt;array[$key] = $value;
            }
        }
    }
    
    public function offsetGet($key)
    {
        if (array_key_exists($key, $this-&gt;array))
        {
            return $this-&gt;array[$key];
        }
    }
    
    public function offsetSet($key, $value)
    {
        if ($key)
        {
            $this-&gt;array[$key] = $value;
        }
        else
        {
            $this-&gt;array[] = $value;
        }
    }
    
    public function offsetUnset($key)
    {
        if (array_key_exists($key, $this-&gt;array))
        {
            unset($this-&gt;array[$key]);
        }
    }
    
    public function offsetExists($key)
    {
        return array_key_exists($key, $this-&gt;array);
    }
    
    public function append($value)
    {
        $this-&gt;array[] = $value;
    }
    
    public function count()
    {
        return count($this-&gt;array);
    }
    
    public function getIterator()
    {
        return new ArrayIterator($this-&gt;array); 
    }
    
    public function __toString()
    {
        return &#039;Array&#039;;
    }
}</description>
		<content:encoded><![CDATA[<p>class MyArrayObject extends ArrayObject<br />
{<br />
    protected $array = array();</p>
<p>    public function __construct($array = array())<br />
    {<br />
        foreach ((array) $array as $key =&gt; $value)<br />
        {<br />
            if (is_array($value))<br />
            {<br />
                $this-&gt;array[$key] = new self($value);<br />
            }<br />
            else<br />
            {<br />
                $this-&gt;array[$key] = $value;<br />
            }<br />
        }<br />
    }</p>
<p>    public function offsetGet($key)<br />
    {<br />
        if (array_key_exists($key, $this-&gt;array))<br />
        {<br />
            return $this-&gt;array[$key];<br />
        }<br />
    }</p>
<p>    public function offsetSet($key, $value)<br />
    {<br />
        if ($key)<br />
        {<br />
            $this-&gt;array[$key] = $value;<br />
        }<br />
        else<br />
        {<br />
            $this-&gt;array[] = $value;<br />
        }<br />
    }</p>
<p>    public function offsetUnset($key)<br />
    {<br />
        if (array_key_exists($key, $this-&gt;array))<br />
        {<br />
            unset($this-&gt;array[$key]);<br />
        }<br />
    }</p>
<p>    public function offsetExists($key)<br />
    {<br />
        return array_key_exists($key, $this-&gt;array);<br />
    }</p>
<p>    public function append($value)<br />
    {<br />
        $this-&gt;array[] = $value;<br />
    }</p>
<p>    public function count()<br />
    {<br />
        return count($this-&gt;array);<br />
    }</p>
<p>    public function getIterator()<br />
    {<br />
        return new ArrayIterator($this-&gt;array);<br />
    }</p>
<p>    public function __toString()<br />
    {<br />
        return &#8216;Array&#8217;;<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: AmdY</title>
		<link>http://amdy.su/spl-in-php-arrayobject/comment-page-1/#comment-98</link>
		<dc:creator>AmdY</dc:creator>
		<pubDate>Sat, 27 Dec 2008 11:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://amdy.su/?p=90#comment-98</guid>
		<description>В таком случае спасает рекурсия в конструкторе, в конечном итоге будет ещё и обёртка для строк и итератор, статью о котором я всё никак не могу дописать. Всё это очень пригодится для обработки входных данных из $_REQUEST</description>
		<content:encoded><![CDATA[<p>В таком случае спасает рекурсия в конструкторе, в конечном итоге будет ещё и обёртка для строк и итератор, статью о котором я всё никак не могу дописать. Всё это очень пригодится для обработки входных данных из $_REQUEST</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: amdy.su @ 2012-02-07 14:37:00 -->
