Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73203 invoked from network); 2 Dec 2016 13:54:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2016 13:54:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.46 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.46 mail-oi0-f46.google.com Received: from [209.85.218.46] ([209.85.218.46:35947] helo=mail-oi0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/88-01781-22D71485 for ; Fri, 02 Dec 2016 08:54:43 -0500 Received: by mail-oi0-f46.google.com with SMTP id v84so265810655oie.3 for ; Fri, 02 Dec 2016 05:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=trnCxrzPX+UJ/ly/7LJED+uMYX8H/43WGKO3maSs+Bw=; b=oTqkEqX3yvrEynooLM/hO/LpzUFo8GuNIbLmu+GoCEF6B2zxpkbIFX4N9UaRVkEuTJ 2hovg+3ok1GFHIi+IocJwDF+u0vSEM11WQKD9FAGY+AvyQwk92DFa1jxK/uR91hxlTBZ PiX0Kkzvi9v1A69VGx42BBHg0gzYSI3IC5vc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=trnCxrzPX+UJ/ly/7LJED+uMYX8H/43WGKO3maSs+Bw=; b=fhpkZRBEMsdM3CksLvw3ZFiVvNW8ZuFkXPxCSsmZANEE8MX3L+1UM8pDuPpLb4vead 7moLuVXBQaoJivXmW49dPYXpOuyNNvtUWEoAh6O5jtv6yA4VnSmNOubYcoCqf1/N57mG vjN1Y5vcozJ/SiZ4rq2e5Y9VX9dHK96u3EfQOgcs4O8mcs4A3y4AHmypC7CaEO4iZssv JfPaJ4DU3KwuT5KOFu09/UK+5a+RBV6goHHUsi9/poRLns6vobJa5PHY/2d+YLXG/NdC GZjVYAE7Oz0ECCaU6PtADucd9XxfUxoNGgnCE0tUJxCWPHlXGyFehe56IroKH8zHRY07 fT9w== X-Gm-Message-State: AKaTC0154io/UwBFDEe89nePr1L16crVzBb+Mv11bDXdUbAn2QV0Ys3uBF4tFfawmPk1DnMAiugUWQZ8MAwe2A== X-Received: by 10.157.48.4 with SMTP id d4mr25349495otc.110.1480686880516; Fri, 02 Dec 2016 05:54:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.252.88 with HTTP; Fri, 2 Dec 2016 05:54:40 -0800 (PST) In-Reply-To: References: Date: Fri, 2 Dec 2016 15:54:40 +0200 Message-ID: To: Alex Bowers Cc: PHP Content-Type: multipart/alternative; boundary=001a11352ed889816f0542ad47b6 Subject: Re: [PHP-DEV] Re: [Concept] Magic Casting From: narf@devilix.net (Andrey Andreev) --001a11352ed889816f0542ad47b6 Content-Type: text/plain; charset=UTF-8 Hi, On Fri, Dec 2, 2016 at 3:44 PM, Alex Bowers wrote: > And because the email formatting appears bad (at least in externals.io) > > Here it is in a gist: > https://gist.github.com/alexbowers/9520c8df746249ecae2d9c7aad2e54ae > There's been a few times I've wanted something like that, but I don't really like the idea of yet another magic method. Especially given the obvious limitation of just one parameter being accepted, the whole thing may work with just an interface: interface Castable { public function __construct($whatever); } Cheers, Andrey. --001a11352ed889816f0542ad47b6--