PHP Classes

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

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 191 All time: 8,583 This week: 660Up
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
Innovation award
Innovation award
Nominee: 3x

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:191
This week:0
All time:8,583
This week:660Up