Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean variables parses as string #129

Closed
barbushin opened this issue Oct 28, 2015 · 5 comments
Closed

Boolean variables parses as string #129

barbushin opened this issue Oct 28, 2015 · 5 comments

Comments

@barbushin
Copy link

In .env

debug=true

In PHP

$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
var_dump(getenv('debug'));

Output:

string 'false' (length=5)

PHP 5.6, dotenv v2.0.1, Windows 10x64

@tuupola
Copy link

tuupola commented Oct 28, 2015

Environment variables are case sensitive.

var_dump(getenv('DEBUG'));

Yields

string(4) "true"

@barbushin
Copy link
Author

So what? It's still string(4), not boolean.

@tuupola
Copy link

tuupola commented Oct 28, 2015

Point is, your example .env and getenv() call do not match. In any case there is discussion about boolean values.

@barbushin
Copy link
Author

It was just a typ :D In my project code is correct, without type. Otherwise var_dump dieplayed NULL.

@GrahamCampbell
Copy link
Collaborator

Duplicate of #104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants