EllisLab/CodeIgniter — Issue #1019: Validation: int 0 passed as NULL to callback
Author: RS71
Created: 2012-02-09 03:10:29+00:00
State: open

I'm getting something I didn't expect -- if I have a POST value of (int) 0, I get NULL in my callback. Is this expected behavior or am I doing something wrong?

Controller:

```
public function index()
{
$_POST['test_field'] = 0;

$this->load->library('form_validation');

$this->form_validation->set_rules('test_field', 'test_field', 'callback__test_zero');

var_dump($this->form_validation->run());

var_dump(form_error('test_field'));
}

public function _test_zero($val)
{
var_dump($val);
return TRUE;
}
```