null assignment to bit variable

Unknown W. Brackets unknown at simplemachines.org
Mon Aug 14 21:07:59 PDT 2006


Just remember, D is not PHP :).

As it would happen, the way PHP/Zend does it is using a struct:

enum zval_type
{
	IS_NULL,
	IS_STRING,
	IS_INTEGER,
}

struct zval
{
	zval_type type = zval_type.IS_NULL;
	union
	{
		char[] str_val = null;
		int int_val = 0;
	}
}

I'm also primarily a PHP programmer, by the way ;).

-[Unknown]


> Hi,
> 
> the following doesn't work:
> 
> bit test; 
> test = null; 
>  
> I understand that this is not possible, but coming from the PHP world, I'm
> looking for a way to define that "test" hasn't got a value yet, not even
> true or false.
> 
> Is that possible? Is there a workaround?
> 
> Thanks!
> Peter



More information about the Digitalmars-d mailing list