Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104636 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4847 invoked from network); 11 Mar 2019 00:19:54 -0000 Received: from unknown (HELO mail-it1-f174.google.com) (209.85.166.174) by pb1.pair.com with SMTP; 11 Mar 2019 00:19:54 -0000 Received: by mail-it1-f174.google.com with SMTP id l139so4215162ita.5 for ; Sun, 10 Mar 2019 14:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X07YuowZTNRS9SH82AhK5a+OQx0jdCD8XPtlwzH4Va8=; b=O+VxR02ypSiLH1NKqXcalwwIjTYXjZyuPY+kzQBpLp2lx2j5SXP/O6BaMY70hw+oI3 N8ena+s+0kccOPznji9cKjIrqPfvJDc3cf60M3bPV87uUxdL6lLuKx+3K1VorhnzHYvA 14iJBvIB9KLRNfQui1J3YbbPGpENOz5zX1quWwMYoAfY3+maPktfYoJQgvdOb0OUTHpd EAZOqT8hXk6rQgu91q1EIKWP6ua0vifYB1i1sLMfnKE7ja6DwVYZ9k3oYH8zZdoGlNJ6 vsXW1GH2+wdK311aNmUN9Fide4Hm8y0CiORPAejg6sgredQYxxlsgZ9dO8fxusNuVl79 d1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X07YuowZTNRS9SH82AhK5a+OQx0jdCD8XPtlwzH4Va8=; b=mE92zkWIdt6dl1N0SH0Z8Adg1vi/t441Gf31vxfQAKXFSQps350qkH0gYRyVaO4QF5 fKeBIkjtxG3SS/BA2YeHNs8WMr39jnvUD08RJps2zQqnbcdC2hwF9oFReVJ/SWCbUrhe wrnvyBEAvQT0MAH7q6bjmj0GypLZXn3tLs9EjRIBCCVZ7/FDh37k+IvPnShihs7JaHoQ c5rjhUpbg4ayTxxrtmfLEcgK93JbPPLJERo+JPnzY6MAc0A+Q5STzv2j/HOMz2Y58C7b qTJNGe0s5GiUqG46Mdv0coad6m9sHptVh51YotFuk+i5aWJLYGjX2NBS2zCK9/DQVIf3 eWPw== X-Gm-Message-State: APjAAAWMKLs8BWG0LGl/EBhT+9WmKdsu1zb/kEBJFAkLAESSQnTBmp5z Wnz/o5sSnia+n1IBxbs3gUYxmmNu3cn18QWVfA8= X-Google-Smtp-Source: APXvYqzAOH/rXLse5HCzQZK0g3odKIZaaxfiaiQHRVe7RRXE9zy8ZgdO5JFBJFGWLaK81MVbtrcN+bEc3iOhe1rAPOM= X-Received: by 2002:a02:7124:: with SMTP id n36mr16491105jac.122.1552252162112; Sun, 10 Mar 2019 14:09:22 -0700 (PDT) MIME-Version: 1.0 References: <2c497732-96f8-3ef0-bc18-912220fbff4d@gmail.com> <78aa28fb-28dc-0ecc-23bc-b0b8806d1e46@gmail.com> In-Reply-To: <78aa28fb-28dc-0ecc-23bc-b0b8806d1e46@gmail.com> Date: Sun, 10 Mar 2019 22:09:09 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000b9851a0583c3de7b" Subject: Re: [PHP-DEV] RFC: Locked Classes From: ocramius@gmail.com (Marco Pivetta) --000000000000b9851a0583c3de7b Content-Type: text/plain; charset="UTF-8" Still feasible though: PRs to https://github.com/Roave/Dont/tree/master/src/Dont welcome On Sun, 10 Mar 2019, 21:56 Rowan Collins, wrote: > On 10/03/2019 20:19, Dan Ackroyd wrote: > > trait LockedClass > > { > > public function __set($name, $value) > > { > > throw new \Exception("Property [$name] doesn't exist for class [" . > > get_class($this) . "] so can't set it"); > > } > > public function __get($name) > > { > > throw new \Exception("Property [$name] doesn't exist for class [" . > > get_class($this) . "] so can't get it"); > > } > > } > > > Incidentally, this isn't quite equivalent to the current RFC, because it > will also intercept access to private or protected properties from out > of scope. It doesn't make much difference other than making the error > messages less helpful, but it's an example of how a nice userland > implementation isn't quite as trivial as it first looks. > > Regards, > > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --000000000000b9851a0583c3de7b--