PHP: access a parent's static variable from an extended class' method

Viewed 7781

Still trying to figure out oop in PHP5. The question is, how to access a parent's static variable from an extended class' method. Example below.

<?php
error_reporting(E_ALL);
class config {
    public static $base_url = 'http://example.moo';
}
class dostuff extends config {
   public static function get_url(){
      echo $base_url;
    }
}
 dostuff::get_url();
?>

I thought this would work from experience in other languages.

2 Answers
Related