Re: Could you have a OOP methodology access to array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 3, 2014 at 8:58 AM, Jim Lucas <lists@xxxxxxxxx> wrote:

> On 09/03/2014 03:12 AM, Vitold S wrote:
>
>> $a = new Array();
>> $a->append("hello");
>> $a->shift();
>> $p = $a->pop();
>>
>> $b = Array::fill(fill_char="*", count=20)
>> $b->pop()
>>
>
> Do you mean this?
>
> http://php.net/manual/en/class.arrayobject.php


ArrayObject implements only a handful of the array functions. It misses
most of the array_* functions such as array_keys, array_fill,
array_intersect, etc. Since the underlying array is stored in a private
field, you'd either need to create your own class or use reflection in a
subclass (ick) to add these other features.

Cheers,
David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux