Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91443 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65915 invoked from network); 27 Feb 2016 18:59:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2016 18:59:55 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:33826] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/1A-55238-B22F1D65 for ; Sat, 27 Feb 2016 13:59:55 -0500 Received: by mail-wm0-f41.google.com with SMTP id p65so23465070wmp.1 for ; Sat, 27 Feb 2016 10:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=8/Pfp4wN+oCwEMLvpT0yb7ptjd+QmGiRLx2Bu03FwIk=; b=WcJqc/O6QzexzM0BMBobyc20e2gRcLgkPnzA3LTXwR2amo0VYndxT5+Q7v3QGb9WBN jHK1IWIfPqtSIwhGFgdZ3cgKKIkcrnYN9btOkZZX05m0zbVEHHdquMLZdcyfoNk0yCb3 Ezqf0YpzPpGpFKGnyJsdjtvhUJa6VRHpoQnQE72ZZW4Kg7UxtJmfhr0mCygUc0bf4hkd Gd0IfUPatzSB8vgGsvW5qE4AAF5rIjVFgm55Z4I47LN0o3GrjKwMR44/8FDWLEk1w+qr tb8dposcDcM8SLtCfrmTxDSP6w57yxLeWV2MBFGxg5DsfIO78V/bJB+gp+Up28Qj0JGB fSJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=8/Pfp4wN+oCwEMLvpT0yb7ptjd+QmGiRLx2Bu03FwIk=; b=EmvassJmRv1ha4IFcSHp5LVIljUGWpt1OztRP1FFoKI/2pV2OdT6eroA/Ha/tyrLDO DpgNp/nrqKAVY1HcxyeHG8w0zTHoddOjQnx6wCJDVKJsaHJgNHYUsc36UnOwHCrCUybe 80ns3wzlumqR8qBTBfUkOFtmPniSbaZ0MPf+aTbgz2biw07QQReLv0gEm7jwoZbmWyIj V58FKRjjvCTJtVQ4T00zYX1A5Yv0E+pI/n/3OTeeahIq25Bv1H2qHbkXDTpQZelXdOlQ pX2d3rEfCFcxm2n1whVvVAHgk1KdAqP/EnvT7G0SwcwY2sxWWA/z9B1T4jMr8M10bStv 7nyA== X-Gm-Message-State: AD7BkJJziLhpwEzo/d7LCGPDtv8mh2liktsF85NY7RB+hGvTTqO/fVQQ17GpJLu06XVfRw== X-Received: by 10.194.58.234 with SMTP id u10mr7317176wjq.174.1456599591892; Sat, 27 Feb 2016 10:59:51 -0800 (PST) Received: from [192.168.1.189] ([95.148.161.211]) by smtp.googlemail.com with ESMTPSA id js8sm17909144wjc.37.2016.02.27.10.59.50 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Feb 2016 10:59:50 -0800 (PST) To: internals@lists.php.net References: <97.82.11730.D8C3FC65@pb1.pair.com> <56CF63D8.8020005@gmail.com> Message-ID: <56D1F21E.404@gmail.com> Date: Sat, 27 Feb 2016 18:59:42 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Callable constructors From: rowan.collins@gmail.com (Rowan Collins) On 26/02/2016 11:47, Nikita Nefedov wrote: >>> Then we could add to that a special case for constructors: >>> >>> - Callable::forConstructor(string $class_name) >>> >> >> Oh, that's quite a clean solution, I like that. Heck, no need for >> Callable, we already have ->getClosure() in Reflection. A modified >> version of that for constructors could work >> (ReflectionClass::getConstructorClosure() ?). >> >> Thanks. > > Hey Andrea, > > This would still not solve Dan's problem though. Which is representing > `new Class` as a serializeable callable. There are lots of types of callable which can't be serialized already - anonymous functions, invokable objects, instance methods - so I'm still not convinced why this particular one is so important. Anything that can only take its callback as a string already rejects many things that are otherwise callable, so I'm not sure why having to reject a wrapped constructor is so much worse that it needs a new language concept. Regards, -- Rowan Collins [IMSoP]