Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123990 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 A1F5D1A009C for ; Fri, 28 Jun 2024 17:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719594541; bh=T14vWZqvcQxf3SZ4pwmRTZwtLdQsDtY5F0Fq4fUGDAE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bDYPpr0meOZ9+cKzfV0+hwHePkz3D9+fiOIETtiOxwFz1bIV37z4guHa1/dO4M//X L+l6bu1HBRF5KkFDFwR0o6d5BomzIul2Yysnz6J7BCmQtF+dIkLD7iIk7nmd3ka7wO 7VrkVjmn2DSt63EoZ9sPZXS9/9CQ3ie4Yf8LAJuCHKW7hnhhpLd59JrdeX+jgmdHkz uAYvqL+NHq9Q2ohRW1SqrHsmILuPdLGEajWb/65Q+Rn77N+T1HYsb91BMsl2hiD8NM NPGJOLiHgNWJhsJVUaGkIHrxQVP2gAWsLbpz8PvZUlHsB8VM9q0TGY12MdQTnIvrh9 E6TUTjPJtacVQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8F00F18005B for ; Fri, 28 Jun 2024 17:09:00 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 ; Fri, 28 Jun 2024 17:09:00 +0000 (UTC) Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-700cd2cba7bso531545a34.0 for ; Fri, 28 Jun 2024 10:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719594460; x=1720199260; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=T14vWZqvcQxf3SZ4pwmRTZwtLdQsDtY5F0Fq4fUGDAE=; b=H1DS7k/DvXjZdby6MWGOaBEYX5JnKOfQeFHb5mYbjPgvx4v1dwNiWsajSAoqm3q8Lz vRz8npetdvilLyfcVaMrRM1tPLEWSL0G5QZBSup73qTGNkKrlqhVMJzUIcBHNVTTHl91 0ZX7M9kmTtdIwGd1csOT/YKPJnSazv/u8kyCihmMtMZ1XrqSMnyKrknWwMptYZQpqAWV 56pSTVtHF1cx/QJOiAeWP7aVR3LiXe3BvcCzXXa4l8SrXYxbv+RqNHTCF7RKHAT/a8FN zGEIND57iFjDC6hFPa4f3HVZZHVBTkJrXlfdhaKPxQVMq7LVsXXRPDjZcMGWd/L3SIsi jk+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719594460; x=1720199260; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T14vWZqvcQxf3SZ4pwmRTZwtLdQsDtY5F0Fq4fUGDAE=; b=QZ86diB9UH1hJeLrWOYXanW1DLrhBuWWFAj+r1DJDXPh7KPgIfERCXoVOotigUOSRX G5qgoWyrP/CK0e7k1paUoza+3IBCU1grXFidpQobn+phoDpBfNphy7fE6Bd9PZ2K2eK6 g6X8RZnvDBgl1E/P3GXx5UD5vQeuEe+Vn2D4k7scAGPxXqMCR5Wlki7pJo7iSH4SjTEK qe1QU+hNoiYpAIbNOzdgtIgNTjcNjcVGvQ4KrXhqwY7e4/VGesoaAIrkzoquxhrjparT S63gZLtQguRqQ7ogWGXS9l884nZ4PS820gU6ganpy/ULz1LW42Du4UPFrgczhcAiAO5D yvyg== X-Forwarded-Encrypted: i=1; AJvYcCUa5Zj2tOoEeAtLNemkNo13Nuu+r6GJCuA7mKn2hw3qzUclH9vrSTGiztUXpcrkY1CHR996HNXh6ncEDT3mFiBb1lKqo+lqqQ== X-Gm-Message-State: AOJu0YyNfmB90Zc+L9fkNousnlLmlExzQhH60VGSTFr+y8k2ei/MIRo+ 65sksxhSaOSZ8lKgcvx+2WlYxeZXOetQnkM8w+voAWk4vunT1UWeU6cVAkASSBQ/wQKfr/9MzdA 6mFf/rQ+KV6SGPiaUbyCAxvns/+U= X-Google-Smtp-Source: AGHT+IGTyc1Hog75YCi9tYDxyb5z7CehBMCUOjP/A7oxLWtYdyWB3fOlWfIXOhikFTZqCODS7AR9Z+HMObFOzgLk0hI= X-Received: by 2002:a9d:7d93:0:b0:6fc:25d6:2613 with SMTP id 46e09a7af769-700b11a824bmr17792191a34.1.1719594460505; Fri, 28 Jun 2024 10:07:40 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <554ffb9e-35c5-466e-aace-0501eee3d0bd@bastelstu.be> <6452BECC-BB20-48DC-9595-324EA70E6A67@newclarity.net> In-Reply-To: Date: Fri, 28 Jun 2024 11:07:30 -0600 Message-ID: Subject: Re: [PHP-DEV] [RFC] Static class To: Lynn Cc: Mike Schinkel , =?UTF-8?Q?Tim_D=C3=BCsterhus?= , Bilge , php internals Content-Type: multipart/alternative; boundary="000000000000f9ef9f061bf648c4" From: lnearwaju@gmail.com (Lanre) --000000000000f9ef9f061bf648c4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2024 at 1:05=E2=80=AFAM Lynn wrote: > > > On Fri, Jun 28, 2024 at 2:48=E2=80=AFAM Mike Schinkel wrote: > >> >> and inheritance is not meant for code reuse. >> >> Just because code reuse in inheritance can be problematic it does not >> have to be in all-cases. Moderation in all things. I used that approach = for >> 10+ years and never once had any of the problems people claim about usin= g >> inheritance for code reuse. This was likely because my needs were >> constrained by the use-case and by nature did not grow out of control wi= th >> complexity. >> > > My experience is the opposite. There are subtle bugs I keep running into > with static function and properties causing unexpected behavior. I'm not > against having static classes open by default for the sake of consistency= , > though my preference would be to avoid the headache altogether and just > make them final by default so I won't ever have to deal with it. Would > traits not solve the problem of horizontal reuse? > Sounds like a 'you' problem. Can you go into more details about said subtle bugs? With examples if possible? Lanre --000000000000f9ef9f061bf648c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Jun 28, 2024 at 1:05=E2=80=AF= AM Lynn <kjarli@gmail.com> wr= ote:


On Fri, Jun 28, 2024 at 2:48=E2=80=AFAM Mike Sch= inkel <mike@new= clarity.net> wrote:
>> and inheritance is not meant for code reuse.

Just because code reuse in inheritance can be problematic it does not have = to be in all-cases. Moderation in all things. I used that approach for 10+ = years and never once had any of the problems people claim about using inher= itance for code reuse. This was likely because my needs were constrained by= the use-case and by nature did not grow out of control with complexity.

My experience is the opposite. There are = subtle bugs I keep running into with static function and properties causing= unexpected behavior. I'm not against having static classes open by def= ault for the=C2=A0sake of consistency, though my preference would be to avo= id the headache altogether and just make them final by default so I won'= ;t ever have to deal with it. Would traits not solve the=C2=A0problem of ho= rizontal=C2=A0reuse?


=
Sounds like a 'you' problem. Can you go into more detail= s about said subtle bugs? With examples if possible?=C2=A0

Lanre
--000000000000f9ef9f061bf648c4--