Skip to content

Instantly share code, notes, and snippets.

@marcw
Created February 25, 2011 11:00
Show Gist options
  • Save marcw/843643 to your computer and use it in GitHub Desktop.
Save marcw/843643 to your computer and use it in GitHub Desktop.
<?php
class mA
{
const TEST = 'mA';
public function getSelf()
{
return self::TEST;
}
public function getStatic()
{
return static::TEST;
}
public function getThis()
{
return $this::TEST;
}
}
class mB extends mA
{
const TEST = 'mB';
}
$t = new mB();
echo "getSelf : " . $t->getSelf()."\n";
echo "getStatic : " . $t->getStatic()."\n";
echo "getThis : " . $t->getThis()."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment