Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67825 invoked from network); 16 Aug 2013 00:00:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2013 00:00:47 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.160.48 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.160.48 mail-pb0-f48.google.com Received: from [209.85.160.48] ([209.85.160.48:35920] helo=mail-pb0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/CB-06453-EAB6D025 for ; Thu, 15 Aug 2013 20:00:47 -0400 Received: by mail-pb0-f48.google.com with SMTP id ma3so1361808pbc.7 for ; Thu, 15 Aug 2013 17:00:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xjSLi5kGg2aubdE8gHgO/tFwd0DeeRXyJb2p+P+ZP64=; b=UHinbr6H7nMn5LSCWIVo7UldwhHB94nr3DLcDoAiCo8AWWQmbOLpkQObMmEFtfhfAU yJoOnY290175o0KrjuKiX0RzU576rnPi1xpiASKj0QzfX5mN7ZHAhhW6ZYL8SUrWpB4a 2qgh6MkQkAaR08Hwi/UTB3l/o1ZaH5jx9wz8lATrGJmwpMe7xiMp+DHqqbpTSfzSXx8l Rsmx6KyFkeWZMPuOdMPtch9HZeQS3AR8KBaZJ5DIeVGw2DqXerYbI1kAZbcikk9b64Xm ZvXpSwCGTSsY4ubzwuQ8HLKbjodpPnjkR4RyVQxLjQXjskrQrYFleXCZJEXzjmqphOM7 AMYQ== X-Gm-Message-State: ALoCoQmnsi6dVF1L2yhsrOTCOc6m4bvi+Frx8OXhDKPTFSUZyfY7om18pl72FedCHykxy/cq12Rk MIME-Version: 1.0 X-Received: by 10.68.27.37 with SMTP id q5mr11257621pbg.145.1376611243714; Thu, 15 Aug 2013 17:00:43 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.24.33 with HTTP; Thu, 15 Aug 2013 17:00:43 -0700 (PDT) X-Originating-IP: [173.252.71.189] In-Reply-To: <520D6758.4050500@sugarcrm.com> References: <520B4772.8090701@sugarcrm.com> <520BBA89.1090208@sugarcrm.com> <520D6758.4050500@sugarcrm.com> Date: Thu, 15 Aug 2013 17:00:43 -0700 X-Google-Sender-Auth: tP-ItGInfJ9nkHckPN5FM47OLAc Message-ID: To: Stas Malyshev Cc: Derick Rethans , Anthony Ferrara , Sebastian Krebs , Julien Pauli , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=bcaec520f1872cfdad04e4054825 Subject: Re: [PHP-DEV] [RFC] Constant Scalar Expressions From: pollita@php.net (Sara Golemon) --bcaec520f1872cfdad04e4054825 Content-Type: text/plain; charset=ISO-8859-1 if(true) return; > class Foo { > const halfpie = M_PI/2; > } > > Oooh, excellent point. Wave a finger and tell the user not to do that? I wasn't going to bring this up, but an intersectional idea I had a few years ago.... Static Constructor. Just like an instance constructor, but called on initial load. class Foo { public static __static_construct(/* no args allowed */) { /* Run on class load, similar to (main), but without better determinance */ } } * Reduces the footprint wherein a class's definition *can* change. * Solves the early exit problem * If exposed to userspace, could provide a nice encapsulation for things like stream_wrapper_register() calls. --bcaec520f1872cfdad04e4054825--