|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-08-25 15:43 UTC] cmb@php.net
-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: cmb
[2021-08-25 15:43 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ Since list is a language construct, it would be great if it had type hinting. list(ContractPrice $price, Adjustment $adj) = $deps; truth be told I got this whim from PHPUnit, where I like having type hinting on my @dependent tests -- example is based on that. Test script: --------------- /** * @depends testReturns_ContractPrice */ function testReturnsArray(ContractPrice $price) { $adjustment = new Adjustment; $this->assertEquals('stuff', $price->stuff($adjustment)); return array($price, $adjustment); } /** *@depends testReturns_Array */ function testTypeHintingLists(array $deps) { list(ContractPrice $price, Adjustment $adjustment) = $deps; }