Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98305 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14374 invoked from network); 15 Feb 2017 19:53:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2017 19:53:58 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.216.172 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.216.172 mail-qt0-f172.google.com Received: from [209.85.216.172] ([209.85.216.172:36837] helo=mail-qt0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/91-01562-2D1B4A85 for ; Wed, 15 Feb 2017 14:53:55 -0500 Received: by mail-qt0-f172.google.com with SMTP id k15so147159694qtg.3 for ; Wed, 15 Feb 2017 11:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=axKMaewCthtIGKVm4ChQKC2pp/IYKh6/jq75RVlJ/rk=; b=LaJwZaQ6mdsbzbuI8TJ1IrKkXhvn/7/zFt7oLslf5BTyV6UZRbjXV/omg+h33B/NsL pzLyLZUfzvaHRgArjK+UigS3rGCIPUgLpOzMDgletKGRANW8phg9aydbIVf8+ctplogG sQdbnbJrv8mzuQH/KPFElDVjcs1RO9ZKG8CJxD7TROkY6G7AOCH9kS1E2F8vhzXJ0JjS IMEGOfk5j+RkKr5oSKcLU20ZYgOjSrzdqapTPZuTPLxRHlhLlt/pn6+ijDJw8KupqXSB GVp9HFMtUzup9xoItb0bmZtH18QCHshQhsYBHJzVbNzIoi5DSEbqv7ZvBbJtgnhGpBCh zmkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=axKMaewCthtIGKVm4ChQKC2pp/IYKh6/jq75RVlJ/rk=; b=Xho8WtmsQ7+Tp7CRUDKEoZfwrr/mkMlcLdqUxmgeNkLVA38xK28Fzgdmpml13ZVnav Kxz6vjVcPS52htusSDp/Km1hG/U868Caojroj80dQAOhrHmsnp888Mkt6hNQZyhBloy4 shIE4Sq4sykRIbKCy8ook4bZlh2+VrpMAath/UU9jidQFAgqTI0jjYDQ62br4oT6+PSh aUHUKsXHDv3ghSgTw8Z1n3+s8UpmOSx+/NKH1v2cuOK51nm4tBf0EgdNojMV5e/frcue g4qne++7w5bhjo4LCkZ7QXfxb0zoUUkJVx3jHBnTp5x7M1juZI5kCO0m4iqMqF1TLYMf zwNw== X-Gm-Message-State: AMke39llQFJo32rZkTyeuxk/rOmvHWNMm39cr5EGBPzCxXOF3p6pS3PTqtPcpg8hEuJo+Aru+anHz16655auTw== X-Received: by 10.200.47.129 with SMTP id l1mr33337823qta.148.1487188431775; Wed, 15 Feb 2017 11:53:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.47.231 with HTTP; Wed, 15 Feb 2017 11:53:51 -0800 (PST) In-Reply-To: References: Date: Wed, 15 Feb 2017 20:53:51 +0100 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113776f230dba70548970ae0 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint, now with added variance From: rasmus@mindplay.dk (Rasmus Schultz) --001a113776f230dba70548970ae0 Content-Type: text/plain; charset=UTF-8 In the light of this, maybe enums (assuming this feature comes first) should be implemented as immutable objects rather than values? Type-checking for enums would be important, so in PHP terms, an enum "instance" would likely be closer to an object than a value in nature anyway. The way I look at it, this feature doesn't prevent enums from happening, it just changes the design parameters. Just a thought. On Wed, Feb 15, 2017 at 4:34 PM, Andrea Faulds wrote: > Hi Marco, > > Marco Pivetta wrote: > >> >> Since the engine is clueless about types until autoloading happens, this >> is >> easily solvable by providing a marker syntax for non-object hints. For >> instance `function foo() : enym:MyEnum {}` >> > > If we're going to do prefixes for non-classes, we might as well copy C > outright: `enum MyEnum`. > > Thanks. > -- > Andrea Faulds > https://ajf.me/ > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113776f230dba70548970ae0--