Re: Closures and type hinting

From: Date: Fri, 12 Oct 2012 21:01:01 +0000
Subject: Re: Closures and type hinting
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-63380@lists.php.net to get a copy of this message
Hi! > Now if you pass a closure to the scan method which doesn't follow the > signature of the __invoke method, the engine should throw an error. > > What do you think? You are trying to take typing way beyond what PHP (or probably any mainstream dynamic language that exists now) provides. There are languages which provide static type systems capable of doing such things, but PHP isn't one of them and I don't think it should be. PHP has no static type control, and IMHO doing type safety validation at runtime does not seem to be a good proposition for PHP. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#63380) next »