~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to Zend/tests/bug30702.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #30702 cannot initialize class variable from class constant
 
3
--FILE--
 
4
<?php
 
5
class foo {
 
6
        const C1=1;
 
7
}
 
8
 
 
9
class bar extends foo {
 
10
  const C2=2;
 
11
 
 
12
  public $c1=bar::C1;
 
13
  public $c2=bar::C2;
 
14
 
 
15
  public $c3=self::C1;
 
16
  public $c4=self::C2;
 
17
 
 
18
  public $c5=foo::C1;
 
19
  public $c6=parent::C1;
 
20
}
 
21
 
 
22
$x= new bar();
 
23
var_dump($x);
 
24
?>
 
25
--EXPECT--
 
26
object(bar)#1 (6) {
 
27
  ["c1"]=>
 
28
  int(1)
 
29
  ["c2"]=>
 
30
  int(2)
 
31
  ["c3"]=>
 
32
  int(1)
 
33
  ["c4"]=>
 
34
  int(2)
 
35
  ["c5"]=>
 
36
  int(1)
 
37
  ["c6"]=>
 
38
  int(1)
 
39
}