As we now use 32bit status, couldn't it be done in PHP ?

```php
$stat1_or  = bindec(trim(str_replace("x", "0", $stat1)));
$stat1_and = bindec(trim(str_replace("x", "1", $stat1)));
$stat2_or  = bindec(trim(str_replace("x", "0", $stat2)));
$stat2_and = bindec(trim(str_replace("x", "1", $stat2)));

return decbin(((((0 | $stat1_or) & $stat1_and)) | $stat2_or) & $stat2_and)
```