Is there an equivalent to C++'s std::vector in PHP?

Desmond Hume

Is there a lightweight replacement for PHP's array to be used when I don't need any of the associated array functionality? From what I know, array is a hash map internally, which is excessive and inefficient for storing a simple array of elements. If PHP had a class or programming construct similar to C++'s std::vector, it would be just great.

Reference: http://www.cplusplus.com/reference/vector/vector/

bitWorking

Have a look at SPL datastructures. An example is http://www.php.net/manual/en/class.splfixedarray.php which is faster than normal array.

http://www.php.net/manual/en/spl.datastructures.php

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Java equivalent to C++ std::vector?

From Dev

Equivalent of C++ std::vector, std::deque and std::map in FreePascal

From Dev

What's the equivalent of a functor map across a vector in c++

From Dev

Equivalent of std::pair in C

From Dev

Equivalent of std::pair in C

From Dev

C++11 std::multiplies on vector containing 0's

From Dev

How to initialize a list of std::vector's values in C++11?

From Dev

Is there a C++ equivalent to PHP's var_dump and die?

From Dev

looking for c# equivalent of php's password-verify()

From Dev

C# Equivalent of PHP's raw output MD5?

From Dev

Does C++'s std::regex have an equivalent to Python's re.MULTILINE?

From Dev

Returning Vector in C++ equivalent to c#

From Dev

is there a equivalent c++ vector::back in c#

From Dev

C++ vector, java array equivalent?

From Dev

equivalent of int[] + k on vector in c++

From Dev

C++ Warming std vector

From Dev

C++ vector with std::map?

From Dev

PHP's strstr() equivalent for JavaScript

From Dev

PHP equivalent of Ruby's rescue

From Dev

PHP's strstr() equivalent for JavaScript

From Dev

C++ casting a std::vector<Derived>* to std::vector<Base> ...?

From Dev

Std vector of std matrices (vector of vectors) in c++

From Dev

Equivalent of std::aligned_storage<> in C?

From Dev

std::copy from vector's position to vector's position

From Dev

std::copy from vector's position to vector's position

From Dev

What's Julia's equivalent named vector in R?

From Dev

Objective C Categories Equivalent In PHP

From Dev

Equivalent C# of this PHP code

From Dev

Equivalent C# of this PHP code