<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.uri-rfc3986-uri.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'uri-rfc3986-uri.withscheme.php',
    1 => 'Uri\\Rfc3986\\Uri::withScheme',
    2 => 'Modify the scheme component',
  ),
  'up' => 
  array (
    0 => 'class.uri-rfc3986-uri.php',
    1 => 'Uri\\Rfc3986\\Uri',
  ),
  'prev' => 
  array (
    0 => 'uri-rfc3986-uri.withquery.php',
    1 => 'Uri\\Rfc3986\\Uri::withQuery',
  ),
  'next' => 
  array (
    0 => 'uri-rfc3986-uri.withuserinfo.php',
    1 => 'Uri\\Rfc3986\\Uri::withUserInfo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uri/uri/rfc3986/uri/withscheme.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="uri-rfc3986-uri.withscheme" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Uri\Rfc3986\Uri::withScheme</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.5.0)</p><p class="refpurpose"><span class="refname">Uri\Rfc3986\Uri::withScheme</span> &mdash; <span class="dc-title">Modify the scheme component</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-uri-rfc3986-uri.withscheme-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Uri\Rfc3986\Uri::withScheme</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">$scheme</code></span>): <span class="type">static</span></div>

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


 <div class="refsect1 parameters" id="refsect1-uri-rfc3986-uri.withscheme-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">scheme</code></dt>
    <dd>
     <span class="simpara">
      New scheme component.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-uri-rfc3986-uri.withscheme-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   The modified <span class="classname"><a href="class.uri-rfc3986-uri.php" class="classname">Uri\Rfc3986\Uri</a></span> instance.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-uri-rfc3986-uri.withscheme-errors">
  <h3 class="title">Errors/Exceptions</h3>
  
  <p class="simpara">
   If the resulting URI is invalid, a <span class="exceptionname"><a href="class.uri-invaliduriexception.php" class="exceptionname">Uri\InvalidUriException</a></span> is thrown.
  </p>

 </div>


 <div class="refsect1 examples" id="refsect1-uri-rfc3986-uri.withscheme-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="uri-rfc3986-uri.withscheme.example.basic">
   <p><strong>Example #1 <span class="methodname"><strong>Uri\Rfc3986\Uri::withScheme()</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 />$uri </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Uri\Rfc3986\Uri</span><span style="color: #007700">(</span><span style="color: #DD0000">"https://example.com"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$uri </span><span style="color: #007700">= </span><span style="color: #0000BB">$uri</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">withScheme</span><span style="color: #007700">(</span><span style="color: #DD0000">"http"</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$uri</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getScheme</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:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">http</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-uri-rfc3986-uri.withscheme-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="uri-rfc3986-uri.getrawscheme.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getRawScheme()</a> - Retrieve the raw scheme component</span></li>
   <li><span class="methodname"><a href="uri-rfc3986-uri.getscheme.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getScheme()</a> - Retrieve the normalized scheme component</span></li>
   <li><span class="methodname"><a href="uri-whatwg-url.withscheme.php" class="methodname" rel="rdfs-seeAlso">Uri\WhatWg\Url::withScheme()</a> - Modify the scheme component</span></li>
  </ul>
 </div>

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