[PHP-DEV] Bug #13363: variable variables with arrays

2001-09-18 Thread developer

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.6
PHP Bug Type: Scripting Engine problem
Bug description:  variable variables with arrays

$dynvar = GLOBALS[first][second];
echo $$dynvar;

result : nothing , no error and no output!

for arrays stored in variables only to ways are working:

$dynvar = GLOBALS;
echo ${$dynvar[first][second]};

or more dynamic but more slower!

$dynvar = .?PHP echo \$GLOBALS[first][second]; ?.;
eval $dynvar;

you can use a variable to store instead of echo!

I think this breaks the rules of assigning variable variables . It must be
possible to store the complete call of the array in a variable. 

The Way implemented jet is not praktical! Real World Tested! There are
so much postings in many Forums and Mailinglist with no suggestion . I
can't understand this! So i must think this is a BUG! or was forgotten to
realize!

-- 
Edit bug report at: http://bugs.php.net/?id=13363edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11835: Include and Require does not work inner a class definition.

2001-07-02 Thread developer

From: [EMAIL PROTECTED]
Operating system: win nt 4
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  Include and Require does not work inner a class definition.

Require nor Include works inner a class file.

This is the file where I define the class:
= 1.php =
?
class test {
  include(2.php); //the same with require
}
?
=  end  =

And this is the file where I have content.
= 2.php =
?
var $a=1;
function method1 () {
  $this-a++;
}
?
=  end  =

This does not work.
The error is:

Parse error:  parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or 
`'}'' 



-- 
Edit Bug report at: http://bugs.php.net/?id=11835edit=1



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11835 Updated: Include and Require does not work inner a class definition.

2001-07-02 Thread developer

ID: 11835
User Update by: [EMAIL PROTECTED]
Status: Closed
Bug Type: Scripting Engine problem
Operating system: win nt 4
PHP Version: 4.0.4pl1
Description: Include and Require does not work inner a class definition.

Well
include is not allowed there is not sufficient.

I have 200+ classes that have a common declaration of variables and methods.
Everytime I need  to modify this declarations I have to modify this 200+ files.

If I could use require or include there I had only one file to modify.

- Original Message - 

 ID: 11835
 Old-Status: Open
 Status: Closed
 Bug Type: Scripting Engine problem
 
 include is not allowed there, use the constructor instead
 class {
 function class () {
 include('2.php'); //same with require
 }
 }
 
 
 
 Previous Comments:
 ---
 
 [2001-07-02 09:14:57] [EMAIL PROTECTED]
 
 Require nor Include works inner a class file.
 
 This is the file where I define the class:
 = 1.php =
 ?
 class test {
   include(2.php); //the same with require
 }
 ?
 =  end  =
 
 And this is the file where I have content.
 = 2.php =
 ?
 var $a=1;
 function method1 () {
   $this-a++;
 }
 ?
 =  end  =
 
 This does not work.
 The error is:
 
 Parse error:  parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or 
`'}'' 
 
 
 ---
 

Previous Comments:
---

[2001-07-02 09:19:33] [EMAIL PROTECTED]

include is not allowed there, use the constructor instead
class {
function class ()   {
include('2.php'); //same with require
}
}



---

[2001-07-02 09:14:57] [EMAIL PROTECTED]

Require nor Include works inner a class file.

This is the file where I define the class:
= 1.php =
?
class test {
  include(2.php); //the same with require
}
?
=  end  =

And this is the file where I have content.
= 2.php =
?
var $a=1;
function method1 () {
  $this-a++;
}
?
=  end  =

This does not work.
The error is:

Parse error:  parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or 
`'}'' 


---


Full Bug description available at: http://bugs.php.net/?id=11835


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11836: Require nor Include works inner a class file

2001-07-02 Thread developer

From: [EMAIL PROTECTED]
Operating system: ms nt 4
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  Require nor Include works inner a class file

Require nor Include works inner a class file.

I have 200+ classes that have a common declaration of variables and methods.
Everytime I need  to modify this declarations I have to modify this 200+ files.

If I could use require or include there I had only one file to modify.

This is the file where I define the class, it's only a LITTLE example:

= class_test.php =
?
class test {
  var $b=0;
  var $c=1;
  function test() { //this is the constructor
//some code here
  }
  
  include(common_declarations.php); //same with require
}
?
  end  


And this is the file where I have the common declarations for 200+ files.

= common_declarations.php =
?
var $common_variable1=1;
function common_method1 () {
  $this-b++;
}
function common_method2 ($p=1) {
  $this-b=$p;
}
//etc
?
=  end  =

This does not work, the error is:


Parse error:  parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or
`'}'' 




-- 
Edit Bug report at: http://bugs.php.net/?id=11836edit=1



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11836 Updated: Require nor Include works inner a class file

2001-07-02 Thread developer

ID: 11836
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Operating system: ms nt 4
PHP Version: 4.0.4pl1
Description: Require nor Include works inner a class file

It's a good idea. 
Thank you.
I still hope that require and include will works innner class declaration in future.

Previous Comments:
---

[2001-07-02 10:24:46] [EMAIL PROTECTED]

Why don't you move your common variables and methods to a separate class, and have 
your 200 classes extend it?

---

[2001-07-02 09:41:47] [EMAIL PROTECTED]

Not a bug, this was never supposed to work. making this a feature request.

Derick

---

[2001-07-02 09:39:39] [EMAIL PROTECTED]

Require nor Include works inner a class file.

I have 200+ classes that have a common declaration of variables and methods.
Everytime I need  to modify this declarations I have to modify this 200+ files.

If I could use require or include there I had only one file to modify.

This is the file where I define the class, it's only a LITTLE example:

= class_test.php =
?
class test {
  var $b=0;
  var $c=1;
  function test() { //this is the constructor
//some code here
  }
  
  include(common_declarations.php); //same with require
}
?
  end  


And this is the file where I have the common declarations for 200+ files.

= common_declarations.php =
?
var $common_variable1=1;
function common_method1 () {
  $this-b++;
}
function common_method2 ($p=1) {
  $this-b=$p;
}
//etc
?
=  end  =

This does not work, the error is:


Parse error:  parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or
`'}'' 



---


Full Bug description available at: http://bugs.php.net/?id=11836


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11579: errors in output

2001-06-20 Thread developer

From: [EMAIL PROTECTED]
Operating system: win nt server 4.0 sp5
PHP version:  4.0.5
PHP Bug Type: *General Issues
Bug description:  errors in output

I just upgraded to 4.0.5 from 4.0.4 but the problem remains.
It seems that when the output is very long the engine inserts strange characters like 
ffb , 1005 , 108e. It seems also that this errors repeats regularly into the 
output. NB: the output is generated through while cycle inner a recursive function.


-- 
Edit Bug report at: http://bugs.php.net/?id=11579edit=1



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]