Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116656 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3607 invoked from network); 16 Dec 2021 17:18:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Dec 2021 17:18:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BC084180511 for ; Thu, 16 Dec 2021 10:20:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 16 Dec 2021 10:20:39 -0800 (PST) Received: by mail-vk1-f181.google.com with SMTP id 70so17364030vkx.7 for ; Thu, 16 Dec 2021 10:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=N0QXYbyn9z3RIMTD4j0m9MTDtXCryBWu83xYBxcRU3g=; b=R/K27B/Nlcy4/RC3ka8BSNyTj92T3RQE5mIiRvTpExS+PHs7y50a/mv5dtXCGuBaij S2eHjc1Jse6KiEaY2BUg3BY1wjT74JSz6YBQKYCE9TYytes5GHZrKD2yVUsZGy4psGGI N+X/zgSznGSe61AWTXGfFsJm9gA5sYzCq8VBBGIKRsh5A2dhrdiFBMhn2d7K1brXtP5B SEuqoDrV95RgwMOo7SFCN+wnr3RIHZz7mb9rTrSQqE34R9UV4GRPjHeDRaQ7pGg4S+kT I7Q/kRNJqyhj4FkzlN20uhBiJ+MQy7RPKZmDX5LMqefTkljo6YCngpL0V9q7hYRWYO9x aj/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=N0QXYbyn9z3RIMTD4j0m9MTDtXCryBWu83xYBxcRU3g=; b=l/PuazMI55Satvovj3lUPbHrVgDu3w0SyQnQJMW1qemiWL4iQgRXIswWuV4UndCW00 nsFCvKmu6ZqRbzr4FiegqQy4AZi2IsqAOU8XaqjeZJDDJNqovVYwSzSYugC5l31+D9jI jMjHzwXQAMlAZxFCUCFDRqvHzg7htDGYIu1s0PG19nkxhbdHFnwyY6710RHTjQBYiVVk NxCLfUVR8zcKaLw6PSNEa0Rb6rWPKnjvHbls1hpQJxTdiiNaWVoK818oNi7V+XSIvxGh R6DPiGl7WTloXnY4KHqRgmANfOR/qTguxFpo/fqWcN+qJPGkS3pZxHHzFMtMMSa84sZG X1og== X-Gm-Message-State: AOAM5307sCC1pnkakbVf7uaj+1Smzj4c9D9mznUpZrKhmzHbbTS3rc9a 3xfEl+jDr5WGfVUmr8PxGXUizk9JXUyUfWxDmJOavA== X-Google-Smtp-Source: ABdhPJw5P5A0Rep7anp1+i7zt7oPl1XUnAMJMCCwEfD+ixDiMHQLiZnz1EB2JZqrcwGkdwrDTxaWBJJE5faEpp4Xug4= X-Received: by 2002:a1f:5ec1:: with SMTP id s184mr1625635vkb.28.1639678838327; Thu, 16 Dec 2021 10:20:38 -0800 (PST) MIME-Version: 1.0 References: <44b3fb4b-4693-1639-c8c0-5e17296c196e@gmail.com> <4b58c011-ed87-ba87-201d-0cf8e4116c6f@processus.org> In-Reply-To: Date: Thu, 16 Dec 2021 18:20:27 +0000 Message-ID: To: Andreas Hennings Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6) From: Danack@basereality.com (Dan Ackroyd) On Thu, 16 Dec 2021 at 12:21, Andreas Hennings wrote: > Methods and functions have searchable and clickable names. Operators don'= t. > The "searchable" applies to grep searches in code, but also google That's one of the reasons why I prefer a magic methods based approach. function __plus(...){} can be searched for...and for future scope, something like: function __union(...){} is more self-documenting (imo) than: operator =E2=88=AA(...){} > Lack of real parameter overloading > Unlike C++ (or C?), we don't have real method/function overloading > based on parameters. Java is probably a better comparison language than C. I have a note on the core problem that method overloading would face for PHP here: https://phpopendocs.com/rfc_codex/method_overloading But although they both involved the word 'overloading', operator overloading, and method overloading are really separate features. > we cannot have the conditional type hints. btw you can just say 'types'. Unlike some lesser languages, in PHP parameter types are enforced at run-time; they aren't hints. I believe all references to hints (in relation to types at least) have been removed from the PHP manual. cheers Dan Ack