To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Upgrading PHP

Upgrading PHP Issues concerning PHP version upgrades and future releases

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-20-2004, 06:07 PM   #1
rpanning
Tandem Web Works
 
rpanning's Avatar
 
Join Date: Dec 2002
Location: MN, USA
Posts: 444
Concat Class Var

Ok, I'm trying to concat a class var but still cannot. I know it's not possible in version 4 as the docs say so (third gray box down).. I though maybe it would work in PHP 5 but it's still a no go. Just though someone may know of a workaround or why this is not possible..?? I'm trying to do:
PHP Code:
<?php
define
('CONST_EX', 'test');
class
Test {
    
// I want this to be 'testtest'
    
static $example = CONST_EX.'test';
}
// Should print testtest
print(Test::$example);
?>
__________________
Are you a mountain biker and live in Minnesota? Join MORC to help support our trials!
rpanning is offline   Reply With Quote
Old 05-20-2004, 10:23 PM   #2
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
you can't use static to declare a class variable. you can do
Code:
const foo = 'bar' . 'baz';
but not static.
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 05-21-2004, 01:21 AM   #3
rpanning
Tandem Web Works
 
rpanning's Avatar
 
Join Date: Dec 2002
Location: MN, USA
Posts: 444
I've tried that to and just a regular class var. Just seems like you can't concat anything in the var declaration. Are you sure about the static thing? There is documentation on php.net and I tried it out (without concating). Check it out, about 2/3 down. http://www.php.net/zend-engine-2.php
__________________
Are you a mountain biker and live in Minnesota? Join MORC to help support our trials!

Last edited by rpanning; 05-21-2004 at 01:26 AM.
rpanning is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:51 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.