Created
December 23, 2014 02:49
-
-
Save hikari-no-yume/25042f1da1e5ba54cf6f to your computer and use it in GitHub Desktop.
Const autoloading (ab)uses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// make barewords legal! | |
$foo = bar . qux . boo; // no notices | |
use bareword as b; | |
$qux = b\baz; | |
// make barewords *illegal*! | |
$foo = bar; // error! | |
// generate escapes on-the-fly! (https://github.com/TazeTSchnitzel/escapes) | |
$foo = 'hello, world' . \n; | |
// paths! | |
use const path\foo\bar\baz as p; // ['foo', 'bar', 'baz'] | |
// add a new kind of numeric literal! | |
$n = TRI1201111012; // int(33890) | |
// implement a brainfuck interpreter! | |
$f = plus_plus_plus_plus_plus_plus_plus_dot; | |
// THE ONLY LIMIT IS YOUR IMAGINATION! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment