Object matching for PHP