What good are constants if you can't use them in an array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



*sigh*

Why is PHP so lame...

<?php 
class PHPISLAME
{
const STOP = 0;
const START = 1;
const PAUSE = 2;
	
public static $STATES = array(
				STOP => 'Stopped',
				START => 'Started',
				PAUSE => 'Paused'
			 );

public static $STATESHACK = array(
				0 => 'Stopped',
				1 => 'Started',
				2 => 'Paused'
			 );
}

print_r(PHPISLAME::$STATES);

print_r(PHPISLAME::$STATESHACK);
?>

What is this crap!!?:
Array ( [STOP] => Stopped [START] => Started [PAUSE] => Paused ) 

Array ( [0] => Stopped [1] => Started [2] => Paused )

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux