PHP Associative Arrays for C# .NET

I always loved the ease of use of arrays in PHP. Simple, dynamic arrays; arrays with integer indexes or string keys; hash tables, maps, collections, resizable variant arrays; you name it.

In C++, you can refer to Standard Template Library (STL) and use vectors for example if you need a regular dynamically sized array, integers used as keys; or maps if you need to use strings as keys.

In C#, namespace Collections contains similar classes to achieve same results; where a C++ vector is a List or ArrayList, and a map is a Hashtable or Dictionary.

PHP has also similar library called Standard PHP Library (SPL).

Java Collections Framework does the same job with lists and maps.

For common problems, common solutions are provided in these libraries.

What would it look like? This is a simple state machine with some nodes and edges linking nodes to each other.

State Machine

Author: murat

Leave a Reply