#42441 [Opn->Bgs]: Unable to instanciate a class who's name is in a constant

2007-08-30 Thread derick
 ID:   42441
 Updated by:   [EMAIL PROTECTED]
 Reported By:  romain dot tartiere at healthgrid dot org
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: GNU/Linux
 PHP Version:  5.2.3
 New Comment:

A quick close doesn't mean it wasn't a correct close. This is not a
bug, it's not meant to work. And don't lecture us about LALR parsers
when you have no idea how PHP works.


Previous Comments:


[2007-08-27 12:42:34] romain dot tartiere at healthgrid dot org

Thank you for your personalised answer and taking time to read and
understand my bug report.

There is nothing about this behaviour in:
 -
http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new
 - http://php.net/manual/en/language.constants.php

Moreover, the behaviour I describe is common to all programming
languages I know (I don't pretent to know all languages, I just tell
that PHP constants are not like other programming language constants).

According to me, it is just a LALR parser  mistake.

Something like...

stuff: [...]
 | TOK_NEW string '(' ')'
 | TOK_NEW variable '(' ')'

... instead of ...

stuff: [...]
 | TOK_NEW expression '(' ')'

Sorry for being rude, but your copy-paste-reply make me feel my problem
has been underestimated by an inexperienced person. But maybe I am
wrong, then just prove me that what I am talking about is nonsense...

According to me, if I can't do "new a" but can do "b = a; new b", there
is something wrong.



[2007-08-27 10:22:24] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php





[2007-08-27 10:08:45] romain dot tartiere at healthgrid dot org

Description:

If you use define to set the name of a class to a constant, you can't
use it to instanciate the class.

Reproduce code:
---


Expected result:

These way of instanciating the foo class should all work.

Actual result:
--
The two first syntax produce the same result:
Fatal error: Class name must be a valid object or a string





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


#42441 [Opn->Bgs]: Unable to instanciate a class who's name is in a constant

2007-08-27 Thread jani
 ID:   42441
 Updated by:   [EMAIL PROTECTED]
 Reported By:  romain dot tartiere at healthgrid dot org
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: GNU/Linux
 PHP Version:  5.2.3
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:


[2007-08-27 10:08:45] romain dot tartiere at healthgrid dot org

Description:

If you use define to set the name of a class to a constant, you can't
use it to instanciate the class.

Reproduce code:
---


Expected result:

These way of instanciating the foo class should all work.

Actual result:
--
The two first syntax produce the same result:
Fatal error: Class name must be a valid object or a string





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