php-developer-list | 2000111
Date: 11/15/00
- Next message: torben <email protected>: "[PHP-DEV] PHP 4.0 Bug #7835 Updated: define() doesn't work in a class-variable-predeclaration-function-call"
- Previous message: Mike Robinson: "RE: [PHP-DEV] CVS Account Request"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: rl <email protected>
Operating system: Linux
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: define() doesn't work in a class-variable-predeclaration-function-call
<?php
# define_does_NOT_work.php --
#
# testing defines in php4 within predeclaratrion
# function calls
#
# tested on -
# Apache/1.3.14 (Unix) mod_ssl/2.7.1 OpenSSL/0.9.6
# PHP/4.0.3pl1
#
# Author: Richard Leopold <rl <email protected>>
#
############################################################
##
define('__KEY__','this is the KEY');
define('__VALUE__','this is the VALUE');
class TEST {
var $test = array( __KEY__ => __VALUE__ );
function start() {
$this->test = array( __KEY__ => __VALUE__ );
}
function test_define(){
print "Looking for define-keyed array-value: test[".
__KEY__."] = ".
$this->test[__KEY__];
}
}
$test = new TEST;
print("<b>Hello, this server is a </b><br><em>".
$SERVER_SOFTWARE.
"</em><br><br>I think there is a BUG in PHP4:</b>".
"<br>\n");
print("<b>A define doesn't work in a class-variable ".
"predeclaration array-function call ".
"with a __defined__ Parameter .... </b><br>\n");
$test->test_define();
print("<br><br>".
"<b>But when I initialize the class-variable in a ".
"start-function ");
$test->start();
print(", then it works:</b><br>\n");
$test->test_define();
print("<br><br>".
"<b>regards - Richard </b>");
?>
-- Edit Bug report at: http://bugs.php.net/?id=7835&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: torben <email protected>: "[PHP-DEV] PHP 4.0 Bug #7835 Updated: define() doesn't work in a class-variable-predeclaration-function-call"
- Previous message: Mike Robinson: "RE: [PHP-DEV] CVS Account Request"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

