Doing it this way seems long winded. You could just do:

    array_splice($attrs, 2, 1, array_map($bool, 'str_to_bool'));

I often get walk and map around the wrong way, but you don't need to declare a function that is just doing one thing :)