note 86592 added to language.oop5.typehinting

From: Date: Sat, 25 Oct 2008 03:26:35 +0000
Subject: note 86592 added to language.oop5.typehinting
Groups: php.notes 
Request: Send a blank email to php-notes+get-145732@lists.php.net to get a copy of this message
One useful thing with Type Hinting that I could not find in the documentation (but tested) is that you can also use an Interface in the hint (versus a Class). This is a very useful tool if you are trying to code to Interfaces rather than Classes (which is common in Test Driven Development and Dependency Injection paradigms). It means your external class can present itself into the method as long as it implements the nominated Interface (obviously). ---- Server IP: 203.88.112.190 Probable Submitter: 122.104.153.43 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.typehinting.php Edit -- https://master.php.net/note/edit/86592 Del: integrated -- https://master.php.net/note/delete/86592/integrated Del: useless -- https://master.php.net/note/delete/86592/useless Del: bad code -- https://master.php.net/note/delete/86592/bad+code Del: spam -- https://master.php.net/note/delete/86592/spam Del: non-english -- https://master.php.net/note/delete/86592/non-english Del: in docs -- https://master.php.net/note/delete/86592/in+docs Del: other reasons-- https://master.php.net/note/delete/86592 Reject -- https://master.php.net/note/reject/86592 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145732) next »