Compat php 5.6. closes #2832