# [RFC DISCUSSION] var_info

- Thread: https://externals.io/message/94262
- Original archive: https://news-web.php.net/php.internals/94262
- Started by Fleshgrinder on 2016-06-26T17:19:07+00:00
- Messages: 4
- RFC: var_info() (Declined) — https://externals.io/rfc/var_info.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #94262 — Fleshgrinder — 2016-06-26T17:19:07+00:00

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

I would like to start the discussion on the already announced var_info()
function. Especially the following open issues should be addressed
before going into voting:

1. Whether to output "negative zero float" for -0.0 or keep "zero
float". This functionality was requested on Reddit but IEEE 754 actually
says that one should ignore the difference. Detecting the negative zero
would also require the signbit functionality from C99 (or weird hacking).
2. Whether to output "invalid object" instead of "object of class
__PHP_Incomplete_Class" to make it more clear cut that this object is wonky.

https://wiki.php.net/rfc/var_info

-- 
Richard "Fleshgrinder" Fussenegger

---

## #94290 — Dan Ackroyd — 2016-06-27T22:44:46+00:00

URL: https://externals.io/message/94262#94290 · In reply to: #94262

> I would like to start the discussion on the already announced var_info()
> function.
>
> https://wiki.php.net/rfc/var_info

The RFC doesn't seem to state any reason why this should be in core,
rather than in a userland library.

cheers
Dan

---

## #94291 — Jesse Schalken — 2016-06-28T02:21:58+00:00

URL: https://externals.io/message/94262#94291 · In reply to: #94262

> I would like to start the discussion on the already announced var_info()
> function. Especially the following open issues should be addressed
> before going into voting:
>
> 1. Whether to output "negative zero float" for -0.0 or keep "zero
> float". This functionality was requested on Reddit but IEEE 754 actually
> says that one should ignore the difference. Detecting the negative zero
> would also require the signbit functionality from C99 (or weird hacking).
>

I think IEEE 754 only specifies that -0.0 and +0.0 be considered equal for
the purpose of numeric equality. That doesn't necessarily mean converting
to a string in some manner should produce the same result. It is already
the case that (string)(float)-0.0 === "-0" and this is how I check for -0.0
in PHP.


> 2. Whether to output "invalid object" instead of "object of class
> __PHP_Incomplete_Class" to make it more clear cut that this object is
> wonky.
>
> https://wiki.php.net/rfc/var_info
>
> --
> Richard "Fleshgrinder" Fussenegger

---

## #94305 — Fleshgrinder — 2016-06-28T16:45:51+00:00

URL: https://externals.io/message/94262#94305 · In reply to: #94291

> The RFC doesn't seem to state any reason why this should be in core,
> rather than in a userland library.
>

I will extend the RFC on the weekend with the missing information,
thanks for the heads up.


> I think IEEE 754 only specifies that -0.0 and +0.0 be considered equal for
> the purpose of numeric equality. That doesn't necessarily mean converting
> to a string in some manner should produce the same result. It is already
> the case that (string)(float)-0.0 === "-0" and this is how I check for -0.0
> in PHP.
> 

Exactly, the question is whether this function should report it or not.

-- 
Richard "Fleshgrinder" Fussenegger
