Skip to content

Instantly share code, notes, and snippets.

@homeyjd
homeyjd / benchmark.php
Created January 7, 2015 04:55 — forked from ranacseruet/gist:8412771
Benchmark ArrayAccess vs. Magic Methods __get/__set() in PHP classes
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
class Test implements ArrayAccess
{
public $data = array();
public function __set($key, $value){
$this->data[$key] = $value;
}