Skip to content

Instantly share code, notes, and snippets.

@alcaeus
Created October 4, 2017 13:19
Show Gist options
  • Save alcaeus/2481b761258f30e75b70431045a130bc to your computer and use it in GitHub Desktop.
Save alcaeus/2481b761258f30e75b70431045a130bc to your computer and use it in GitHub Desktop.
Broken class aliases
<?php declare(strict_types = 1);
if (false) {
// Alias will never be used
class_alias('FakeParentClass', 'ParentClass');
}
class ChildClass extends ParentClass
{
public function bar(): void
{
$this->foo();
}
}
<?php declare(strict_types = 1);
class ParentClass
{
public function foo(): void
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment