Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 9836

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Deprecated features in PHP 7.2.x</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration72.incompatible.html">Backward incompatible changes</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration72.other-changes.html">Other changes</a></div>
 <div class="up"><a href="migration72.html">Migrating from PHP 7.1.x to PHP 7.2.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="migration72.deprecated" class="sect1">
 <h2 class="title">Deprecated features in PHP 7.2.x</h2>

 <div class="sect2" id="migration72.deprecated.unquoted-strings">
  <h3 class="title">Unquoted strings</h3>

  <p class="para">
   Unquoted strings that are non-existent global constants are taken to be
   strings of themselves. This behaviour used to emit an
   <strong><code>E_NOTICE</code></strong>, but will now emit an
   <strong><code>E_WARNING</code></strong>. In the next major version of PHP, an
   <a href="class.error.html" class="classname">Error</a> exception will be thrown instead.
  </p>

  <div class="informalexample">
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">NONEXISTENT</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Output:<br />Warning:&nbsp;Use&nbsp;of&nbsp;undefined&nbsp;constant&nbsp;NONEXISTENT&nbsp;-&nbsp;assumed&nbsp;'NONEXISTENT'&nbsp;(this&nbsp;will&nbsp;throw&nbsp;an&nbsp;Error&nbsp;in&nbsp;a&nbsp;future&nbsp;version&nbsp;of&nbsp;PHP)&nbsp;in&nbsp;%s&nbsp;on&nbsp;line&nbsp;%d<br />string(11)&nbsp;"NONEXISTENT"<br />*/</span>
</span>
</code></div>
   </div>

  </div>
 </div>

 <div class="sect2" id="migration72.deprecated.png2wbmp-jpeg2wbmp">
  <h3 class="title"><span class="function"><a href="function.png2wbmp.html" class="function">png2wbmp()</a></span> and <span class="function"><a href="function.jpeg2wbmp.html" class="function">jpeg2wbmp()</a></span></h3>

  <p class="para">
   The <span class="function"><a href="function.png2wbmp.html" class="function">png2wbmp()</a></span> and <span class="function"><a href="function.jpeg2wbmp.html" class="function">jpeg2wbmp()</a></span>
   functions from the GD extension have now been deprecated and will be removed
   in the next major version of PHP.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.INTL_IDNA_VARIANT_2003-variant">
  <h3 class="title"><strong><code>INTL_IDNA_VARIANT_2003</code></strong> variant</h3>

  <p class="para">
   The Intl extension has deprecated the
   <strong><code>INTL_IDNA_VARIANT_2003</code></strong> variant, which is currently
   being used as the default for <span class="function"><a href="function.idn-to-ascii.html" class="function">idn_to_ascii()</a></span> and
   <span class="function"><a href="function.idn-to-utf8.html" class="function">idn_to_utf8()</a></span>. PHP 7.4 will see these defaults changed to
   <strong><code>INTL_IDNA_VARIANT_UTS46</code></strong>, and the next major version of
   PHP will remove <strong><code>INTL_IDNA_VARIANT_2003</code></strong> altogether.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.__autoload-method">
  <h3 class="title"><span class="function"><a href="function.autoload.html" class="function">__autoload()</a></span> method</h3>

  <p class="para">
   The <span class="function"><a href="function.autoload.html" class="function">__autoload()</a></span> method has been deprecated because it is
   inferior to <span class="function"><a href="function.spl-autoload-register.html" class="function">spl_autoload_register()</a></span> (due to it not being
   able to chain autoloaders), and there is no interoperability between the two
   autoloading styles.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.track_errors-and-php_errormsg">
  <h3 class="title"><code class="parameter">track_errors</code> ini setting and <em>$php_errormsg</em> variable</h3>

  <p class="para">
   When the <code class="parameter">track_errors</code> ini setting is enabled, a
   <em>$php_errormsg</em> variable is created in the local scope when
   a non-fatal error occurs. Given that the preferred way of retrieving such
   error information is by using <span class="function"><a href="function.error-get-last.html" class="function">error_get_last()</a></span>, this
   feature has been deprecated.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.create_function-function">
  <h3 class="title"><span class="function"><a href="function.create-function.html" class="function">create_function()</a></span> function</h3>

  <p class="para">
   Given the security issues of this function (being a thin wrapper around
   <span class="function"><a href="function.eval.html" class="function">eval()</a></span>), this dated function has now been deprecated.
   The preferred alternative is to use <a href="functions.anonymous.html" class="link">anonymous functions</a>.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.mbstringfunc_overload-ini-setting">
  <h3 class="title"><code class="parameter">mbstring.func_overload</code> ini setting</h3>

  <p class="para">
   Given the interoperability problems of string-based functions being used in
   environments with this setting enabled, it has now been deprecated.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.unset-cast">
  <h3 class="title"><em>(unset)</em> cast</h3>

  <p class="para">
   Casting any expression to this type will always result in <strong><code>NULL</code></strong>, and so
   this superfluous casting type has now been deprecated.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.parse_str-no-second-arg">
  <h3 class="title"><span class="function"><a href="function.parse-str.html" class="function">parse_str()</a></span> without a second argument</h3>

  <p class="para">
   Without the second argument to <span class="function"><a href="function.parse-str.html" class="function">parse_str()</a></span>, the query
   string parameters would populate the local symbol table.
   Given the security implications of this, using
   <span class="function"><a href="function.parse-str.html" class="function">parse_str()</a></span> without a second argument has now been
   deprecated. The function should always be used with two arguments, as the
   second argument causes the query string to be parsed into an array.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.gmp_random-function">
  <h3 class="title"><span class="function"><a href="function.gmp-random.html" class="function">gmp_random()</a></span> function</h3>

  <p class="para">
   This function generates a random number based upon a range that is
   calculated by an unexposed, platform-specific limb size. Because of this,
   the function has now been deprecated. The preferred way of generating a
   random number using the GMP extension is by
   <span class="function"><a href="function.gmp-random-bits.html" class="function">gmp_random_bits()</a></span> and
   <span class="function"><a href="function.gmp-random-range.html" class="function">gmp_random_range()</a></span>.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.each-function">
  <h3 class="title"><span class="function"><a href="function.each.html" class="function">each()</a></span> function</h3>

  <p class="para">
   This function is far slower at iteration than a normal
   <em>foreach</em>, and causes implementation issues for some
   language changes. It has therefore been deprecated.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.assert-string-arg">
  <h3 class="title"><span class="function"><a href="function.assert.html" class="function">assert()</a></span> with a string argument</h3>

  <p class="para">
   Using <span class="function"><a href="function.assert.html" class="function">assert()</a></span> with a string argument required the string
   to be <span class="function"><a href="function.eval.html" class="function">eval()</a></span>&#039;ed. Given the potential for remote code
   execution, using <span class="function"><a href="function.assert.html" class="function">assert()</a></span> with a string argument has now
   been deprecated in favour of using boolean expressions.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.errcontext-arg-of-error-handlers">
  <h3 class="title"><em>$errcontext</em> argument of error handlers</h3>

  <p class="para">
   The <em>$errcontext</em> argument contains all local variables of
   the error site. Given its rare usage, and the problems it causes with
   internal optimisations, it has now been deprecated.
   Instead, a debugger should be used to retrieve
   information on local variables at the error site.
  </p>
 </div>

 <div class="sect2" id="migration72.deprecated.read_exif_data-function">
  <h3 class="title"><span class="function"><a href="function.read-exif-data.html" class="function">read_exif_data()</a></span> function</h3>

  <p class="para">
   The <span class="function"><a href="function.read-exif-data.html" class="function">read_exif_data()</a></span> alias has been deprecated.
   The <span class="function"><a href="function.exif-read-data.html" class="function">exif_read_data()</a></span> function should be used instead.
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="migration72.incompatible.html">Backward incompatible changes</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="migration72.other-changes.html">Other changes</a></div>
 <div class="up"><a href="migration72.html">Migrating from PHP 7.1.x to PHP 7.2.x</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>