summaryrefslogtreecommitdiffstats
path: root/static-constant_members.php
blob: 9f2debebad9348b164e99f4ebaa6f67782a88c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

class Base {
    const MODELNUMBER = 0xdeadbeef; /* no 'public' keyword */
    public static $REVISION = 0x2;
    public $foo = 0;

    function __costruct() {
        /* useful naming convention in the longrun if times comes to rename */
    }
}

$d1 = new Base();

print "<h2>" . Base::MODELNUMBER . Base::$REVISION . "</h2>" . PHP_EOL;
print "<h2>" . $d1::MODELNUMBER . $d1::$REVISION . "</h2>" . PHP_EOL; /* -> operator can't access static&const members */