<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.uri-whatwg-url.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'uri-whatwg-url.withpassword.php',
    1 => 'Uri\\WhatWg\\Url::withPassword',
    2 => 'Modify the password component',
  ),
  'up' => 
  array (
    0 => 'class.uri-whatwg-url.php',
    1 => 'Uri\\WhatWg\\Url',
  ),
  'prev' => 
  array (
    0 => 'uri-whatwg-url.withhost.php',
    1 => 'Uri\\WhatWg\\Url::withHost',
  ),
  'next' => 
  array (
    0 => 'uri-whatwg-url.withpath.php',
    1 => 'Uri\\WhatWg\\Url::withPath',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uri/uri/whatwg/url/withpassword.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="uri-whatwg-url.withpassword" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Uri\WhatWg\Url::withPassword</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.5.0)</p><p class="refpurpose"><span class="refname">Uri\WhatWg\Url::withPassword</span> &mdash; <span class="dc-title">Modify the password component</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-uri-whatwg-url.withpassword-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Uri\WhatWg\Url::withPassword</strong></span>(<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><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">$password</code></span>): <span class="type">static</span></div>

  <p class="simpara">
   Creates a new URL and modifies its password component.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-uri-whatwg-url.withpassword-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">password</code></dt>
    <dd>
     <span class="simpara">
      New password component.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-uri-whatwg-url.withpassword-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   The modified <span class="classname"><a href="class.uri-whatwg-url.php" class="classname">Uri\WhatWg\Url</a></span> instance.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-uri-whatwg-url.withpassword-errors">
  <h3 class="title">错误／异常</h3>
  
  <p class="simpara">
   If the resulting URL is invalid, a <span class="exceptionname"><a href="class.uri-whatwg-invalidurlexception.php" class="exceptionname">Uri\WhatWg\InvalidUrlException</a></span> is thrown.
  </p>

 </div>


 <div class="refsect1 examples" id="refsect1-uri-whatwg-url.withpassword-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="uri-whatwg-url.withpassword.example.basic">
   <p><strong>示例 #1 <span class="methodname"><strong>Uri\WhatWg\Url::withPassword()</strong></span> basic example</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$url </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Uri\WhatWg\Url</span><span style="color: #007700">(</span><span style="color: #DD0000">"https://user:password@example.com"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$url </span><span style="color: #007700">= </span><span style="color: #0000BB">$url</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">withPassword</span><span style="color: #007700">(</span><span style="color: #DD0000">"pass"</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$url</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPassword</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>以上示例会输出：</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">pass</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-uri-whatwg-url.withpassword-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="uri-whatwg-url.getpassword.php" class="methodname" rel="rdfs-seeAlso">Uri\WhatWg\Url::getPassword()</a> - Retrieve the password component</span></li>
   <li><span class="methodname"><a href="uri-whatwg-url.getusername.php" class="methodname" rel="rdfs-seeAlso">Uri\WhatWg\Url::getUsername()</a> - Retrieve the username component</span></li>
   <li><span class="methodname"><a href="uri-rfc3986-uri.withuserinfo.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::withUserInfo()</a> - Modify the userinfo component</span></li>
  </ul>
 </div>

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