Created
June 14, 2010 13:46
-
-
Save tty/437700 to your computer and use it in GitHub Desktop.
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 | |
// Show all errors. | |
error_reporting(E_ALL); | |
class beers { | |
const softdrink = 'rootbeer'; | |
public static $ale = 'ipa'; | |
} | |
$rootbeer = 'A & W'; | |
$ipa = 'Alexander Keith\'s'; | |
// This works; outputs: I'd like an A & W | |
echo "I'd like an {${beers::softdrink}}\n"; | |
// This works too; outputs: I'd like an Alexander Keith's | |
echo "I'd like an {${beers::$ale}}\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment