Skip to content

Instantly share code, notes, and snippets.

@salathe
Created July 6, 2011 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salathe/1067290 to your computer and use it in GitHub Desktop.
Save salathe/1067290 to your computer and use it in GitHub Desktop.
<?php
class Example {
public static $member = "Hi Gordon!";
public $another = "Aww :(";
}
// Works fine
$ref = new ReflectionProperty("Example", "member");
var_dump( $ref->getValue() );
// Warning: ReflectionProperty::getValue() expects exactly 1 parameter, 0 given
$ref = new ReflectionProperty("Example", "another");
var_dump( $ref->getValue() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment