Last active
March 15, 2016 09:25
-
-
Save jawira/f86e5c7b0cc1bfd33de0 to your computer and use it in GitHub Desktop.
Simple use of constants within a namespace.
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 | |
/** | |
* Created by PhpStorm. | |
* User: jawira | |
* Date: 15.03.16 | |
* Time: 10:03 | |
*/ | |
namespace Dummy\MyTime; | |
const MONTHS = 12; | |
const WEEKS = 52; | |
const DAYS = 365; | |
namespace Test; | |
use Dummy\MyTime; | |
$daysPerWeek = MyTime\DAYS / MyTime\WEEKS; | |
$daysPerMonth = MyTime\DAYS / MyTime\MONTHS; | |
echo "Days per week: $daysPerWeek\n"; | |
echo "Days per month: $daysPerMonth\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment