mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
45 lines
518 B
PHP
45 lines
518 B
PHP
--TEST--
|
|
Bug #23951 (Defines not working in inherited classes)
|
|
--FILE--
|
|
<?php
|
|
|
|
define('FOO1', 1);
|
|
define('FOO2', 2);
|
|
|
|
class A {
|
|
|
|
public $a_var = array(FOO1=>'foo1_value', FOO2=>'foo2_value');
|
|
|
|
}
|
|
|
|
class B extends A {
|
|
|
|
public $b_var = 'foo';
|
|
|
|
}
|
|
|
|
$a = new A;
|
|
$b = new B;
|
|
|
|
print_r($a);
|
|
print_r($b->a_var);
|
|
print_r($b->b_var);
|
|
|
|
?>
|
|
--EXPECT--
|
|
A Object
|
|
(
|
|
[a_var] => Array
|
|
(
|
|
[1] => foo1_value
|
|
[2] => foo2_value
|
|
)
|
|
|
|
)
|
|
Array
|
|
(
|
|
[1] => foo1_value
|
|
[2] => foo2_value
|
|
)
|
|
foo
|