PHPStrongV - PHP Data Types

PHPStrongV - PHP Data Types

Released 3 years ago , Last update 3 years ago

A lightweight PHP library that provides object-oriented, method driven and (optionally) strongly typed common data types for PHP.

PHPStrongV is a lightweight PHP library that provides object-oriented, method driven and (optionally) strongly typed common data types for PHP. It is inspired from .NET primitive type implementation. In addition, it boasts a Key-Value Dictionary implementation, a dynamically adjusted List implementation as well as LIFO Stack and FIFO Queue implementations. PHPStrongV is a developer's swiss army knife when working with data, providing efficiency, code clearness and optional strong type safety.

How It Works

PHPStrongV implements a class for each data type it provides, providing special methods to manipulate its data. For example, when creating a PHPStrongV based string variable $v, you instantiate an instance of SVString class. The variable is an instantiated SVString class on which you may call methods to manipulate it such as $v->toUpper() etc.


PHP 5.3 or newer

Basic Usage

  • Copy the lib directory in your project under a directory of your choice.
  • Include the PHPStrongV.php file, which is located in the lib directory.
  • Call the appropriate svX function as shown in the Examples section to create variables of different types.


/*** Create a strongly typed string with value 'test' ***/
$var_string = &svstring('test');

/*** Create a weakly typed string with value 'test' ***/
$var_string = svstring('test');

/*** Change the variable's value ***/
$var_string = 'test 2'; // or
$var_string->set('test 2');

/*** Get the variable's value. returns 'test 2' ***/
$value = $var_string->val();

/*** Make the value uppercase ***/
$value = $var_string->toUpper();

/*** Create an integer 32 with value 10 ***/
$var_int = &svint(10);

/*** Get the value of integer 32 ***/
$var_int->val(); // 10

/*** Will throw an exception as '2' is string and not an integer ***/
$var_int32 = '2';

/*** Will throw an exception as value is out of bounds ***/
$var_int32 = 9223372036854775807;
$var_int32 = 2; // correct

/*** Create a new list which accepts strings ***/
$var_list = &svlist('string');
$var_list->addRange(array('element2', 'element3'));
// the list now has the following elements in the order presented:
// element1, element2, element3
// now let's reverse the order of the elements in the list:
// we read the element at index 0 which is 'element3'
$var_element = var_list->at(0);

/*** Create a new dictionary which accepts strings ***/
$var_dic = &svdictionary('string');
$var_dic->add('key1', 'value1');
$var_value = $var_dic->at('key1'); // will return 'value1'
$var_dic->add('key2', 1); // will throw an exception as 1 is not a string.


  • MODERN, Time-Saving & PRODUCTIVE

    By using PHPStrongV, you don't have to use the aging, non-uniform, hard to remember data manipulation functions that the standard PHP library provides. PHPStrongV provides alternatives to everything you will ever need.

    The optional type safety PHPStrongV provides will make sure that you don't have weird code behavior or security issues because of accidental overwriting of variables with incompatible data.


    Good documentation, the modern and uniform collection of data manipulation functions, and strong type support will make sure that you deliver higher quality software in less time and with less cost.



    PHPStrongV provides support for immutable strings with transparent UTF8 support and easy-to-use string manipulation functions.

    PHPStrongV provides signed and unsigned implementations of 8bit, 16bit, 32bit integers as well as support for floats/doubles. Make sure that your values never get out of bounds.

    Α special boolean implementation will ensure that your values always remain of boolean type. Special boolean validation functions are supported.

    An alternative to native PHP associative arrays with easy-to-use lookup functions. Dictionaries will make sure that you don't accidentally overwrite the value of a specific key.

    Provide indexed access to a series of elements by boasting various lookup and manipulation functions as well as predicate function-based filtering.
  • STACKs

    Specialized stack implementation that provides easy access to your data in a stack like manner. Push, pop and peek will become your best friends.
  • QUEUEs

    An easier alternative to native PHP arrays and Lists that provides convenient functions such as enqueue, dequeue and peak.

    PHPStrongV provides optional support for strongly typed variables by implementing a clever algorithm. Make sure that your variables are not accidentally overwritten with invalid data.

    Special care has been put into the internals of PHPStrongV to ensure that it plays nicely with your favorite IDE. Every function is documented according to PHP documentation standards. You will be productive in no time!



14 day 14-day money-back guarantee


Personal License

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Commercial use

  • 1 month support


Premium License

  • Perpetual license

  • 3 projects

  • Can distribute code and binary products

  • Commercial use

  • 12 months support


Business License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use

  • 12 months support

4 licenses, starting from From » FREE View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

Or enter your name and Email
No comments have been posted yet.