title: Unable to Retrieve data from PHP class
body: <p>In the following code I am getting error: <code>Undefined variable: base_url on line 27</code> and <code>Cannot access empty property on line 27</code>.</p>
  
  <p>I need to echo  the parameter <code>http://google.com</code> passed in get_url() from render().</p>
  
  <pre><code>&lt;?php
  
  $smart_url = new smart();
  
  $smart_url -&gt; get_url('http://google.com');
  
  echo  $smart_url -&gt; render();
  
  
   /**
   * Smart URL
   */
  
  class smart {
  
  private $base_url;
  
  /**
   * 
   * @param string $url
   */
  public function get_url($url) {
          $this -&gt; $base_url = $url;
  
  }
  
  
  /**
   * @return string $base_url
   */
  public function render() {
      return $this -&gt; $base_url;
  
  
  }
  
  }
  
  
  ?&gt;
  </code></pre>