Re: [RFC] Scalar Type Hinting With Casts (re-opening)

From: Date: Mon, 14 Jul 2014 23:20:11 +0000
Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-75519@lists.php.net to get a copy of this message
Hi!

> I would have expected 1 - since it appears, from the code, that $a should only contain
> integers.

Until the time you changed it. If you write:

function foo(SplFileInfo $a) {
	$a = 3 / 2;
   }

Would you somehow expect $a to magically conjure SplFileInfo object out
of 3/2?
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/


Thread (250 messages)

« previous php.internals (#75519) next »