arrayobject Questions

3

Solved

Trying to use ES6 arrayObj.sort(a,b) => a.property.localeCompare(b.property) syntax but getting error: TypeError: a.property.localeCompare is not a function. I'm thinking localeCompare is not ...
Aunt asked 18/9, 2021 at 13:15

2

(examples at the bottom!!!) we have just upgrade our backend to PHP7 and after that, we have found a bug in our code related to an ArrayObject. The code just loops over a copy of an Object (type ...
Conde asked 17/10, 2016 at 13:17

7

Can somebody explain clearly the fundamental differences between ArrayIterator, ArrayObject and Array in PHP in terms of functionality and operation? Thanks!
Manthei asked 8/5, 2012 at 16:37

5

Solved

As stated in the title, How do you perform an array_unshift() on a arrayObject, array_push() is obtained by doing an arrayObject->append() but what about unshift ? Edit: What I've forgot to men...
Barnie asked 29/7, 2011 at 15:0

2

Solved

I'm trying to understand STD_PROP_LIST constant in the documentation but so far i didn´t understand it, and didn´t found any explanation :( The documentation has the following example: $a = new Ar...
Cathe asked 30/1, 2013 at 17:41

2

Solved

i have an array like this var data = [ { name: "Movies", info: "category_name", content: [ { name: "Interstellar", info: "category_data" }, { name: "Dark Knight", info: "category_data" }, ]...
Orangewood asked 12/10, 2019 at 16:4

3

Solved

I have an array of objects, and i want to sum value of one of the property.Here is a picture which will show the structre of array. Here is my code,that doesn't work. print_r($res);//this appear ...
Archle asked 9/6, 2015 at 8:16

3

Solved

I have a custom class like this - class Event: NSObject { var eventID: String? var name:String? } Now i have an array of Event object's like var events = [Event]() var event1 = Event() even...
Eclogue asked 18/7, 2016 at 13:1

3

Solved

I have my data in ArrayObject, simply representing an array. I need to filter the data, function array_filter() would work great. However, it does not work with ArrayObject as argument. What's the ...
Acrodrome asked 30/6, 2012 at 14:26

1

Solved

The ArrayObject class allows objects to work as arrays. When I check if an ArrayObject is empty, though, the result is always false echo empty(new ArrayObject()); // returns false Wouldn't it be...
Lovable asked 29/6, 2016 at 15:21

6

Solved

which one should be used to manipulating data, Array or Array Object? Like search,sort and other array manipulations.
Selfappointed asked 9/9, 2009 at 15:28

4

Solved

ideone Sample Code: <?php $a = new ArrayObject(); $a['b'] = array('c'=>array('d')); print_r($a); unset($a['b']['c']); print_r($a); Output ArrayObject Object ( [b] => Array ( [c] =&...
Clinker asked 2/4, 2012 at 18:36

2

Solved

I'm trying to understand the concept of the Object Array in PHP. Up to date I was simply using regular arrays to loop through the list of records and display them in say table. I know that I could...
Oleaster asked 9/7, 2013 at 16:34

2

Solved

TL;DR I want to override offsetSet($index,$value) from ArrayObject like this: offsetSet($index, MyClass $value) but it generates a fatal error ("declaration must be compatible"). What & Why ...
Marrowfat asked 27/11, 2012 at 11:26

1

Solved

I am trying to understand what getIterator() is, I will explain: As I know getIterator is a method we call to include an external Iterator. The problem is getIterator include it's own methods th...
Inconsistent asked 7/7, 2012 at 7:53

3

Solved

Problem: I am trying to extend PHP's ArrayObject as shown below. Unfortunately I can't get it to work properly when setting multi-dimensional objects and instead an error thrown as I have the stric...
Linnealinnean asked 31/8, 2011 at 8:54

2

Solved

I have a question regarding ArrayObject. I wanted to use array_slice in an ArrayObject class and I couldn't. Is there a way to do it, without needing to write an "slice" method to the class that im...
Silvan asked 8/7, 2011 at 16:11

1

Solved

PHP has an in_array function for checking if a particular value exists in an native array/collection. I'm looking for an equivalent function/method for ArrayObject, but none of the methods appear t...
Calise asked 30/7, 2009 at 19:52
1

© 2022 - 2024 — McMap. All rights reserved.