php ordering bugfix