Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103249 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13183 invoked from network); 24 Sep 2018 18:26:42 -0000 Received: from unknown (HELO mail-lj1-f171.google.com) (209.85.208.171) by pb1.pair.com with SMTP; 24 Sep 2018 18:26:42 -0000 Received: by mail-lj1-f171.google.com with SMTP id q127-v6so18438590ljq.11 for ; Mon, 24 Sep 2018 07:34:20 -0700 (PDT) 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=hQb/rY218sxDDOWjMMySGklZAnsGhU/hYu3aOpiHpDQ=; b=UAWuBpa2xXWLH6BAkQWETlIWLh7kSk9V+kgI6ohKoICrlGx9h1aDooeRu98pmRKBaJ pPIs1tFQaUb/ndJUsTy1ZNKqQljm7PetRlQ6X0zc3AfGyo+Q3Bmvn1VY/p7Kvo7/gCNn TtxYnInbt/BUpnX3ZjGauQz+cgxgOq5ist37SwNS64Iw+56PLygVhzgeQGfl0g7jSaVd 5FgwVrIfkFyJjCyc5wOumsSvbEalQJcNtNPaJFQNhGvxf7xvbH53+A8HKwrzxQ+LSaEY x2Dx6a+YulSBID+i7RsI1Njbd8MXBJ15/1fUPV/q8onVfAzdmUryclSFkWaIYhei4uvc OVpA== X-Gm-Message-State: APzg51AptiCPm5VlEgF7trg0XICH4zfer5Cmdas6myFyVbCVd6BT31rt jurlujX5BhKiq0kg4Jk7qO+PI4nNLphNTZF9IHw= X-Google-Smtp-Source: ACcGV61OtF6PnHlmSPy8R1cGvoEpiUSasJFREDbKVCrOUF0HFuZLv3bCIjFac6gVxWW81SEVzoXe5/8yM7AViunA6ao= X-Received: by 2002:a2e:9599:: with SMTP id w25-v6mr10724896ljh.6.1537799659154; Mon, 24 Sep 2018 07:34:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 24 Sep 2018 08:34:02 -0600 Message-ID: To: AGromov@alfabank.ru Cc: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Pre proposal for "Class extension functions" From: levim@php.net (Levi Morrison) On Mon, Sep 24, 2018 at 5:21 AM Andrey O Gromov wrote: > > Hello. > > I want to do RFS proposal for new language concept - Class extension > functions. > > Syntax will looks like: > > function DateTime->localTime() { > return $this->format('H:i'); > } > > $date = new DateTime(); > > echo $date->localTime(); > > > Realisation draft already written ( > https://github.com/rjhdby/php-src/commit/a54d7d3f8504d2e15908bb0e44de0b2f87683872 > ) > > It is interesting or not? Definitely interesting. The patch doesn't seem to handle inheritance conflicts, though. For instance, if I add something to a base class that ends up conflicting with a sub-class that is already defined. It may not need to handle it in any particular way, but should be specified at least.