Skip to content

Instantly share code, notes, and snippets.

@furnox
furnox / AnObj.php
Last active January 2, 2020 19:07 — forked from nick-mok/AnObj.php
This is a revision of Nick Mokisasian's (https://gist.github.com/nickunderscoremok/5857846) revision of George Mihailov's (https://gist.github.com/Mihailoff/3700483) PHP Anonymous Object Class. I wanted to bind $this to the methods in the anonymous class. Coded and tested on PHP 5.5.
<?php
class AnObj
{
protected $methods = array();
protected $properties = array();
public function __construct(array $options)
{