# Internal function/method data type validation practice?

- Thread: https://externals.io/message/97336
- Original archive: https://news-web.php.net/php.internals/97336
- Started by Yasuo Ohgaki on 2016-12-08T01:34:42+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #97336 — Yasuo Ohgaki — 2016-12-08T01:34:42+00:00

URL: https://externals.io/message/97336#97336

Hi all,

What's the best practice of internal function and method data type
validation, both parameter and return types?

Although it seems it is possible to retrieve parameter/return types,
there is no APIs defined in Zend according to ext/reflection or I must
have missed something.

Thank you.

--
Yasuo Ohgaki
yohgaki@ohgaki.net

---

## #97337 — Yasuo Ohgaki — 2016-12-08T01:49:17+00:00

URL: https://externals.io/message/97336#97337 · In reply to: #97336

>
> What's the best practice of internal function and method data type
> validation, both parameter and return types?

Sorry, question is confusing.
I'm trying to validate data types of callbacks which could be both
user defined and internal function/method. What's the best way with
master?

Thank you.

--
Yasuo Ohgaki
yohgaki@ohgaki.net

---

## #97351 — Yasuo Ohgaki — 2016-12-10T09:19:41+00:00

URL: https://externals.io/message/97336#97351 · In reply to: #97336

> What's the best practice of internal function and method data type
> validation, both parameter and return types?
>
> Although it seems it is possible to retrieve parameter/return types,
> there is no APIs defined in Zend according to ext/reflection or I must
> have missed something.
>
> Thank you.

It seems there isn't clean and easy way to introspect and validate
parameters and return type currently.

I'll forget about validating to be registered callback
functions/methods parameter and return type for the time being.

If you have suggestions, I appreciate it.

Regards,

--
Yasuo Ohgaki
yohgaki@ohgaki.net
