On 27.05.2010, at 17:40, Derick Rethans wrote: > On Thu, 27 May 2010, Arvids Godjuks wrote: > >> Please read more carefully - what I mean that is we deal mostly with >> numbers witch are represented as strings, because all data that comes >> from external sources are STRING regardless of actual contents - be >> that integer or float - no matter. I don't want to make my code look >> like this: >> >> function doSomeStuffWithDbData(int $id, string $name, int $someFlag) { >> } >> >> $sql = 'SELECT id, name, some_flag, .... FROM table WHERE .....'; >> $res = mysqli_query($db, $sql); >> $row = $res->fetch_assoc(); >> doSomeStuffWithDbData((int)$row['id'], $row['name'], (int)$row['some_flag']); > > PDO's bind values already provide the correct type if you specify so. So > this is moot point.
well most people do not use that since its just as tedious to use as having to cast your results. of course if we did have strict typing it would probably become more widely used, not that having to add those lines of code are something i would like to see in my code (the speed gains are microoptimizations for most use cases of PHP). regards, Lukas Kahwe Smith m...@pooteeweet.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php