Skip to content

Instantly share code, notes, and snippets.

@Ocramius
Created November 8, 2012 04:03
Show Gist options
  • Save Ocramius/4036708 to your computer and use it in GitHub Desktop.
Save Ocramius/4036708 to your computer and use it in GitHub Desktop.
Broken PHP Magic methods
<?php
class A{
protected $b;
function __construct() {unset($this->b);}
function __get($name){
echo $name;
return $this->$name;
}
}
$a = new A;
$a->b;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment