# Data type coercion

- Thread: https://externals.io/message/58997
- Original archive: https://news-web.php.net/php.internals/58997
- Started by Lester Caine on 2012-03-18T08:58:05+00:00
- Messages: 1
- 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

---

## #58997 — Lester Caine — 2012-03-18T08:58:05+00:00

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

I just though it was worth throwing in this link to the 'debate' on data type 
hints and casting ...
http://dyemanov.blogspot.co.uk/2011/07/data-type-coercion-vs-comparison-rules.html

While it goes back a little time wise, it flags the SQL standard which while 
that is not available to simply view on line ( standards should NOT be a 
commodity! ) a search for "Result of data type combinations" brings up a few 
other views on the 'problem'.

This is another of those areas where cross database working can produce some 
unexpected results, and while using databases with PHP is probably not the 
'norm', it does provide another target with which consistent type management can 
be compared. But having said that, MySQL probably fails to follow the standard 
anyway? In my own case, data from the database normally ends up being returned 
as strings but with validity checks having been carried out in the database 
engine, so further 'hinting' within PHP would tend to be a little redundant.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
