<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.splfileinfo.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'splfileinfo.getpathinfo.php',
    1 => 'SplFileInfo::getPathInfo',
    2 => 'Gets an SplFileInfo object for the path',
  ),
  'up' => 
  array (
    0 => 'class.splfileinfo.php',
    1 => 'SplFileInfo',
  ),
  'prev' => 
  array (
    0 => 'splfileinfo.getpath.php',
    1 => 'SplFileInfo::getPath',
  ),
  'next' => 
  array (
    0 => 'splfileinfo.getpathname.php',
    1 => 'SplFileInfo::getPathname',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/spl/splfileinfo/getpathinfo.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="splfileinfo.getpathinfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplFileInfo::getPathInfo</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.2, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">SplFileInfo::getPathInfo</span> &mdash; <span class="dc-title">Gets an SplFileInfo object for the path</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-splfileinfo.getpathinfo-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SplFileInfo::getPathInfo</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$class</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.splfileinfo.php" class="type SplFileInfo">SplFileInfo</a></span></span></div>

  <p class="para rdfs-comment">
   Gets an <span class="classname"><a href="class.splfileinfo.php" class="classname">SplFileInfo</a></span> object for the parent of the current file.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-splfileinfo.getpathinfo-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">class</code></dt>
     <dd>
      <p class="para">
       Name of an <span class="classname"><a href="class.splfileinfo.php" class="classname">SplFileInfo</a></span> derived class to use, or itself if <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
      </p>
     </dd>
    
   </dl>
  </p>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-splfileinfo.getpathinfo-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns an <span class="classname"><a href="class.splfileinfo.php" class="classname">SplFileInfo</a></span> object for the parent path of the file on success, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-splfileinfo.getpathinfo-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">class</code> is now nullable.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-splfileinfo.getpathinfo-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>SplFileInfo::getPathInfo()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$info </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'/usr/bin/php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$parent_info </span><span style="color: #007700">= </span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPathInfo</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$parent_info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getRealPath</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(8) &quot;/usr/bin&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-splfileinfo.getpathinfo-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="splfileinfo.setinfoclass.php" class="methodname" rel="rdfs-seeAlso">SplFileInfo::setInfoClass()</a> - Sets the class used with SplFileInfo::getFileInfo and SplFileInfo::getPathInfo</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>