Skip to content

Instantly share code, notes, and snippets.

@helhum
Created August 4, 2014 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helhum/7a9668f095c57a12f43c to your computer and use it in GitHub Desktop.
Save helhum/7a9668f095c57a12f43c to your computer and use it in GitHub Desktop.
Class Alias Test
<?php
error_reporting(E_ALL);
class request {}
class_alias('request', 'old_request');
interface foo {
public function baz(\request $request);
}
class bar implements foo {
public function baz(\old_request $request) {
echo 'OK';
}
}
$bar = new bar();
$bar->baz(new request());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment