File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug35509.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month 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: Bug #35509 (string constant as array key has different behavior inside object)
    3: --FILE--
    4: <?php
    5: class mytest
    6: {
    7:   const classConstant = '01';
    8: 
    9:   private $classArray = array( mytest::classConstant => 'value' );
   10: 
   11:   public function __construct()
   12:   {
   13:     print_r($this->classArray);
   14:   }
   15: }
   16: 
   17: $classtest = new mytest();
   18: 
   19: define( "normalConstant", '01' );
   20: $normalArray = array( normalConstant => 'value' );
   21: print_r($normalArray);
   22: ?>
   23: --EXPECT--
   24: Array
   25: (
   26:     [01] => value
   27: )
   28: Array
   29: (
   30:     [01] => value
   31: )

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