title: PHP function inside another function [ class ]
body: <p>I have the following code, perform a global function within a class to fill the functions of wordpress, the problem is that the only way that I could get a variable public class is as follows</p>
  
  <pre><code>class Core {
   public $notice;
   function __construct(){
    $this-&gt;core_function();
  
   }
   function core_function(){
     global $globalvar;
     $globalvar = $this;
     function notice_global(){
      global $globalvar;
  
      return $globalvar-&gt;notice;
  
     } 
   }
   function set_notice(){
    $this-&gt;notice = array('Warning');
   }
  
  }
  
  $GP = new Core();
  $GP-&gt;set_notice();
  var_dump(notice_global());
  </code></pre>
  
  <p>Any other ideas or suggestions, this code is correct or not?</p>