Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created May 8, 2014 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ircmaxell/f38a784a66740ae9d91b to your computer and use it in GitHub Desktop.
Save ircmaxell/f38a784a66740ae9d91b to your computer and use it in GitHub Desktop.
PHP Is Drunk
<?php
class a {
const a = b::c;
const b = b::d;
}
<?php
class b {
const c = a::b;
const d = 1;
}
<?php
spl_autoload_register(function($class) {
require_once __DIR__ . "/" . strtolower($class) . ".php";
});
var_dump(A::a, A::b, B::c, B::d);
@ircmaxell
Copy link
Author

BTW, that outputs:

int(1)
int(1)
int(1)
int(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment