Short answer. Not to a truly unknown individual — Article 845 voids a disposition in favour of an unknown person, unless some event or circumstance later makes his identity certain. But a gift to a definite class or group of persons is valid, even though you cannot name each member when you write the will.
What the law says
Every disposition in favor of an unknown person shall be void, unless by some event or circumstance his identity becomes certain. However, a disposition in favor of a definite class or group of persons shall be valid.
Civil Code, Article 845 — Dispositions to Unknown Persons. Read the full provision →
What Article 845 says
Article 845 provides: Every disposition in favor of an unknown person shall be void, unless by some event or circumstance his identity becomes certain. However, a disposition in favor of a definite class or group of persons shall be valid. The concern is certainty of the beneficiary. A will must be capable of being carried out, and a gift 'to whoever deserves it' or to a person no one can ever identify leaves the executor with nothing to act on. So the general rule voids gifts to unknown persons — but with two important escapes built into the same article.
The first escape: identity that becomes certain
'Unknown' does not mean unnamed at the moment of writing. It means incapable of being identified at all. The article saves a disposition where, by some event or circumstance his identity becomes certain — so you may describe a beneficiary rather than name him, provided the description will point to a definite person when the time comes. A gift to the doctor who attends you in your last illness names no one today, yet the event will fix exactly who is meant. What the law forbids is a beneficiary who can never be pinned down, not one identified by a future fact.
The second escape: a definite class or group
The article's second sentence validates a gift in favor of a definite class or group of persons. Here you need not identify individuals at all — 'my grandchildren living at my death', 'the poor of my barangay', 'the employees of my shop' — because the class is defined even though its exact members are worked out later. The key word is definite. The class must have a boundary the executor can apply; an open-ended or vague grouping fails for the same reason a truly unknown person does. A well-drawn class gift is a standard and perfectly valid way to benefit people you cannot list one by one.
How to draft so the gift survives
If you want to benefit someone you cannot yet name, do not leave the beneficiary at large. Either tie the gift to a fact that will identify a specific person, or define a class with a clear test for who belongs to it and a point in time to apply it. Avoid language that asks the executor to decide, on his own judgement, who deserves the gift — that shades into leaving the disposition itself to another, which the law does not permit. Read the clause back and ask whether a stranger holding only the will could tell exactly who takes.