Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89202 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47345 invoked from network); 13 Nov 2015 10:56:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Nov 2015 10:56:50 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:30443] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/A1-37356-0F1C5465 for ; Fri, 13 Nov 2015 05:56:49 -0500 Received: from [127.0.0.1] (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTPS id 019514B00EA; Fri, 13 Nov 2015 11:56:45 +0100 (CET) To: Stanislav Malyshev , Andrea Faulds , internals@lists.php.net References: <56429DAB.6010005@dasprids.de> <56455965.60101@gmail.com> Message-ID: <5645C1E9.8000206@php.net> Date: Fri, 13 Nov 2015 11:56:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56455965.60101@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 151113-0, 13/11/2015), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] Re: Resource typehint and return type From: francois@php.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Hi, Le 13/11/2015 04:30, Stanislav Malyshev a écrit : > Hi! > >> The reason for this is that the resource type is an anachronism from an >> age in which PHP did not have objects, yet still needed to make certain >> types of data opaque. The resource type is a type that exists only to > I think more specific reason is not that resource type is outdated, but > that resource is not really a type - it's a collection of types. Mysql > connection is a resource, and file is a resource, but they are certainly > not interchangeable. So typing a value as "resource" would not achieve > you much. > I agree. Some resources may disappear in the future but others, like opened streams, are not obsolete at all. As 'resource' is not specific enough. What about including the resource type in some way ? Something like '@stream', '[stream]', '{stream}' ? Just need to replace spaces with underscores (e.g. 'persistent_stream'). Regards François