title: What is a dereferencable scalar in PHP?
body: <p>Recently, I was following <a href="https://talks.php.net/vienna17#/php7uvs" rel="nofollow noreferrer">this PHP talk</a> <sup><a href="https://www.youtube.com/watch?v=fYTKm2oUzAg" rel="nofollow noreferrer">See it on YouTube</a></sup>. There is a part about new features in PHP7 that is a really strange stuff for me (in &quot;Uniform variable syntax&quot; part of the talk), which wrote:</p>
  <pre><code>// support all operations on dereferencable scalars
  // (not very useful)
  &quot;string&quot;-&gt;toLower()
  </code></pre>
  <img src="https://i.stack.imgur.com/E4H0Q.png" alt="Uniform variable syntax part of the PHP talk image">
  <p>What is a dereferencable scalar? I know when I call a method on a non-object, for example:</p>
  <pre><code>echo &quot;string&quot;-&gt;toLower();
  </code></pre>
  <p>I'll get the following Error in PHP7:</p>
  <pre><code>Fatal Error: Uncaught Error: Call to a member function toLower() on string
  </code></pre>
  <p>Also, I cannot find a way to declare methods on strings (like something we see in JavaScript); as I know, there is no way to do it.</p>
  <p>So, what is the code above saying? How can we do the stuff above? What is the use case for it? Saying it generally, what is <code>&quot;string&quot;-&gt;toLower()</code>?</p>
  <p><strong>(Editted) Note:</strong> While the PHP talks says it <em>exists</em> as of PHP 7.0, it seems to be a mistake by Mr. Lerdorf (it could be a rejected patch, for example).</p>
  <p>Thanks in advance.</p>