Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124488 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id DF1BC1A00B7 for ; Thu, 18 Jul 2024 18:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721327093; bh=khcbHE+q2n7kVMYazb+90RycRLv+/q3T7AfQXkTJC30=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lxdXTg7sRZeCvE5RRNgiM1i6fmIRZ3NYXgGnyarnQ6ebhQyJh448rfH2MqywiL+L+ YALrbC2/B8gYXl/X5PhYhlsyHuo/xvVy1mOdqntc9mbvYbVubfz9CnbVyeqItOqNc4 CN1RTEF6h6rsjg2YssY/i8sK/uY1cxBKU1aee0PhxK3mvpjM0Pdk+cp8WDy64AVOXC zGItHZY5zkjEsdWBm0vDwo2+wfrdPVgS6X9Xa+MO29fMZGsDeWn8UMaT608hN+6U2p k7dMDclB30EIJAEYINIvfpz6+RyLIdm5kW367yUyk6sX1a7ywlLH/WhJLdaaDiRhqY EGs727z4bEoMw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD53D18062E for ; Thu, 18 Jul 2024 18:24:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 18 Jul 2024 18:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1721326997; bh=0pw/xBDBvMMPRV0khYLE/wTX26SIZV5w7xltfeMDvVk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=g1Nq0HVtPfm0keOByGgQUYq0zElaCb7t6NnN3rT+yZbtiZqtMsL7weqQuyuOjTTBz 6Z1v/+UTY2Bw8aqeHivbVktH8KJS8HpIdih3RlpM1d+H27/CaIvqTtjF+bHqLY3qff rb/rKQRd1Tp3sLV3WgqTsjF+O/fGLh4c1JE01BkRElYT34MYQL44IsHntPejT7uVVe GDkAf1MY2pBYBa5wlWqbGjHjEt1LF4yZjKPgmlFTcIAv6R0Qh+oxvV/oezo4pW7i0A EDqyzd55wn9GwuXGaBOVZwqeva8qls+QW7YEZj2S0mxwLpTDnkR4MgFJhIlmsOaMTh pEtB780V19hsQ== Message-ID: <5ad05cff-1543-4f8b-bb67-3a8d29171522@bastelstu.be> Date: Thu, 18 Jul 2024 20:23:16 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Optional constructor body To: lilybergonzat+php@gmail.com, Larry Garfield Cc: php internals References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 7/18/24 16:03, Lily Bergonzat wrote: > I feel like the more substantial one would be more likely to break > stuff, compared to the minor one, and so I don't see why the minor one > would be refused? There is no such thing as a minor syntax change. Any changes to the syntax has consequences for all the downstream tools trying to understand PHP. This includes IDEs, static analyzers, code formatting and linting tools, which would all need to be updated to understand the new syntax. Furthermore the syntax would need to be documented and translated within the PHP documentation. That's quite a bit of effort to save a single character per class definition. In practice it will be even fewer, because not every class will have an empty constructor. Also whenever a class gets a non-trivial constructor in the future, the diff would not just consist of inserting the new code into the body, but also replacing the semicolon by braces, making the diff less readable. I do not think this is worth it. Best regards Tim Düsterhus