PHP Classes

PHP JavaScript Object: Create object that works like a JavaScript object

Recommend this page to a friend!
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 191 This week: 1All time: 8,573 This week: 560Up
Version License PHP version Categories
js-object 1.0.1MIT/X Consortium ...5.4PHP 5, Data types, Language
Description 

Author

This class can create an object that works like a JavaScript object.

It can take an array of property values to set the object variables.

The class redefined the __call magic method, so calls to closure function variables have the $this pseudo-variable assigned to the current object, so code of the closure function variables can access the object properties using $this.

Innovation Award
PHP Programming Innovation award nominee
December 2015
Number 8


Prize: SourceGuarding PHP encoder tool
In JavaScript the this pseudo variable refers to the current object associated to a function being called.

In PHP closure functions can be assigned to object functions but the $this pseudo variable does not become associated automatically to the object.

This class can make the $this variable be associated to a closure function assigned dynamically to a class object function.

It uses the __call magic method to properly bind the $this variable when calling an object closure function.

Manuel Lemos
Picture of Kevinralph M Tenorio
  Performance   Level  
Name: Kevinralph M Tenorio <contact>
Classes: 5 packages by
Country: Philippines Philippines
Age: 39
All time rank: 337325 in Philippines Philippines
Week rank: 411 Up4 in Philippines Philippines Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file JSObject.php Class Main Class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:191
This week:1
All time:8,573
This week:560Up