PHP Classes

dynClass: Extends stdClass to have callable functions

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 66%Total: 157 All time: 8,954 This week: 332Up
Version License PHP version Categories
dynclass 1.0.0GNU General Publi...5PHP 5, Data types


This class can extends stdClass to have callable functions.

The __construct function takes an array of values that define either class variables or functions. The variables or functions may also be assigned setting an object value.

Calling a property assigned to a callable function will call the function forwarding any parameters.

Innovation Award
PHP Programming Innovation award nominee
April 2017
Number 7
stdClass is an empty base class built-in PHP that does not contain any functions or variables. It is used to create generic objects.

stdClass objects can be created by converting values of other types to objects. However there are limitations.

The dynClass overcomes some of stdClass limitations by allowing for instance to have assign callable functions to object via the class constructor that takes an array of properties and functions as parameter.

Manuel Lemos
Picture of Chris Jeffries
  Performance   Level  
Name: Chris Jeffries <contact>
Classes: 6 packages by
Country: United Kingdom
Age: 75
All time rank: 2174101 in United Kingdom
Week rank: 703 Up27 in United Kingdom Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file dynClass.class.php Class The class definition
Accessible without login Plain text file Doc. How to use dynClass
Accessible without login Plain text file testdynclass.php Example Test program for dynClass

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,954
This week:332Up
 User Ratings  
 All time