title: How to alias a class method in PHP?
body: <p>Let's say I have a class in PHP with a method that serialises data. Being English, I use the English spelling of <em>-ISE</em>.</p>
  
  <pre><code>class Foo
  {
  
      public function serialise($data)
      {
          return json_encode($data);
      }
  
  }
  </code></pre>
  
  <p>Let's also say that I have an American developer on my team who tries to "serialize" the data (<em>-IZE</em>).</p>
  
  <pre><code>$foo = new Foo();
  $foo-&gt;serialize(['one', 'two', 'three']);
  // PHP Fatal error: Uncaught Error: Call to undefined method Foo::serialize()
  </code></pre>
  
  <p>The obvious way to solve this is to alias the method. My instincts are to create another method with the American spelling and simply pass the same parameters.</p>
  
  <pre><code>class Foo
  {
  
      // ...
  
      public function serialize($data)
      {
          return $this-&gt;serialise($data);
      }
  
  }
  </code></pre>
  
  <p>But this has a couple of downfalls:</p>
  
  <ul>
  <li>I have to match the parameters and remember to update both methods if there's ever an update (error prone).</li>
  <li>Additional function call for American developers means the code is less efficient.</li>
  <li>Modifying one in a sub-class doesn't necessarily update the other.</li>
  </ul>
  
  <p>My question is: <strong>is there a better way to alias a class method in PHP?</strong> A way that can get around the concerns that I have?</p>