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

« back to all changes in this revision

Viewing changes to tests/classes/bug23951.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 #23951 (Defines not working in inherited classes)
 
3
--FILE--
 
4
<?php
 
5
 
 
6
define('FOO1', 1);
 
7
define('FOO2', 2);
 
8
 
 
9
class A {
 
10
    
 
11
    public $a_var = array(FOO1=>'foo1_value', FOO2=>'foo2_value');
 
12
    
 
13
}
 
14
 
 
15
class B extends A {
 
16
 
 
17
    public $b_var = 'foo';   
 
18
            
 
19
}
 
20
 
 
21
$a = new A;
 
22
$b = new B;
 
23
 
 
24
print_r($a);
 
25
print_r($b->a_var);
 
26
print_r($b->b_var);
 
27
 
 
28
?>
 
29
--EXPECT--
 
30
A Object
 
31
(
 
32
    [a_var] => Array
 
33
        (
 
34
            [1] => foo1_value
 
35
            [2] => foo2_value
 
36
        )
 
37
 
 
38
)
 
39
Array
 
40
(
 
41
    [1] => foo1_value
 
42
    [2] => foo2_value
 
43
)
 
44
foo