Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #15293
| From | "M. Strobel" <strobel@example.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | problem with double as array index? |
| Date | 2015-05-06 22:25 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <midt9v$ihf$1@dont-email.me> (permalink) |
I stumbled upon this problem when trying to define a trivalent logic:
Interactive test:
php > if (! define('triFalse',0)) trigger_error('Error defining!');
php > if (! define('triMaybe',0.5)) trigger_error('Error defining!');
php > if (! define('triTrue', 1)) trigger_error('Error defining!');
php >
php > $triNotarray = array(triFalse=>triTrue, triMaybe=>triMaybe, triTrue=>triFalse);
php > var_dump($triNotarray);
array(2) {
[0] =>
double(0.5)
[1] =>
int(0)
}
Where is my Maybe value?
I was not aware of this problem (not coding PHP for some time), what is it?
Here the php -v output:
PHP 5.4.20 (cli)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans
/Str.
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
problem with double as array index? "M. Strobel" <strobel@example.com> - 2015-05-06 22:25 +0200
Re: problem with double as array index? "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-06 22:57 +0200
Re: problem with double as array index? adam <adam@nospam.net> - 2015-05-06 21:12 +0000
Re: problem with double as array index? "M. Strobel" <strobel@example.com> - 2015-05-07 00:45 +0200
Re: problem with double as array index? "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-07 01:08 +0200
Re: problem with double as array index? "M. Strobel" <strobel@example.com> - 2015-05-07 13:36 +0200
csiph-web