PHP 5.5 fixes + unit tests

Still 1 test in 5.5 that fails in JTable. So not quite ready to merge this yet