Deny from env=env-variable Does not work

(Above from Apache docs).

On my system, using:

SetEnvIf User-Agent Mozilla IsBad=1
Order allow,deny
Allow from all
Deny from env=IsBad 

...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs.

Still can't solve this one, although the following inside the same Directory container does:

<Files *>
order deny,allow
deny from 58.218.0.0/16 etc
</Files>