title: Asynchronous PHP function calling
body: <p>I have a function that writes it into a file.</p>
  
  <pre><code>public function write($type = "error", $mensaje = "") { 
      $this-&gt;file = fopen($this-&gt;filePath.$this-&gt;fileName, "a+"); 
  
      if ($this-&gt;file == null) { 
          trigger_error("Error: No file", E_USER_ERROR); 
      } else { 
          fwrite($this-&gt;file, $type." ".$mensaje."\n");
      } 
  }
  </code></pre>
  
  <p>I need to call this function from another php file say index.php</p>
  
  <pre><code>function test() {
      write("testing done");
      echo "done";
  }
  </code></pre>
  
  <p>I want the write function to be called from index.php asynchronously so the current execution doesn't stop or block if the write fails.</p>