Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 20th, 2012  |  syntax: None  |  size: 0.23 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. class foo {
  3.     var $bar = 'I am bar.';
  4. }
  5.  
  6. $foo = new foo();
  7. $bar = 'bar';
  8. $baz = array('foo', 'bar', 'baz', 'quux');
  9. echo $foo->$bar . "\n";
  10. echo $foo->$baz[1] . "\n";
  11. ?>
  12.  
  13. //Output:
  14.  
  15. I am bar.
  16. I am bar.