Skip to content

Instantly share code, notes, and snippets.

@sfgeorge
Forked from bobthecow/yay.php
Created May 17, 2011 18:57

Revisions

  1. Stephen George revised this gist May 17, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion yay.php
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    class A {
    public $foo = null;
    public function getFooClass() {
    return get_class($this->foo);
    return get_class(); // null param means "What's *my* class?"
    }
    }

  2. @bobthecow bobthecow created this gist May 17, 2011.
    11 changes: 11 additions & 0 deletions yay.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php

    class A {
    public $foo = null;
    public function getFooClass() {
    return get_class($this->foo);
    }
    }

    $a = new A();
    var_dump($a->getFooClass());