File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / classes / constants_basic_003.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 6 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Ensure class properties and constants can be defined in terms of constants that are not known at compile time.
    3: --FILE--
    4: <?php
    5:   include 'constants_basic_003.inc';
    6:   class B
    7:   {
    8:       public static $a = A::MY_CONST;
    9:       public static $c = C::MY_CONST;
   10:       const ca = A::MY_CONST;
   11:       const cc = C::MY_CONST;
   12:   }
   13:   
   14:   class C
   15:   {
   16:       const MY_CONST = "hello from C";
   17:   }
   18:   
   19:   var_dump(B::$a);
   20:   var_dump(B::$c);
   21:   var_dump(B::ca);
   22:   var_dump(B::cc);
   23: ?>
   24: --EXPECTF--
   25: string(12) "hello from A"
   26: string(12) "hello from C"
   27: string(12) "hello from A"
   28: string(12) "hello from C"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>