Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127325 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 lists.php.net (Postfix) with ESMTPS id DA4691A00BC for ; Thu, 8 May 2025 21:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746739253; bh=f0zCShu//k6MfKAnEwLg/O3FZvluLuRQKnep4ZI0hDw=; h=References:In-Reply-To:From:Date:Subject:To:From; b=Q639W6HoSUfR/JlFcZWhbj4vepRmWlqO88ukW3k1k9+3zn1nEEhwX4hzgEm+acICJ Ux2N+vbgwasgcODEU1tSkYx73uu2B0Lzwp07BGnAxYLmHjbIWo2I0tsFycMgvYnamU lRbNz/HtkwEiPp66eICbYZSd8Ulxjl1m0pkthEjObREWVETw66oWNJidP12V7bqNJ0 Mt2IjrZ+0Tt/Yt+JaCzfXl0UMNo07lg5mB/Ijue2dq8QAlMFWCHrWuENw8JB3xjzvU aDPn7QZvrdWQ4VcmEx1CfBuhm0PtecpwA2fiZz2bGb3efyP4+sjXCNHjrcQHgdIe0q X2QpZnZRhST4A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8FF8D1801E1 for ; Thu, 8 May 2025 21:20:52 +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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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, 8 May 2025 21:20:52 +0000 (UTC) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6f5440fcf81so26446546d6.0 for ; Thu, 08 May 2025 14:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746739385; x=1747344185; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=f0zCShu//k6MfKAnEwLg/O3FZvluLuRQKnep4ZI0hDw=; b=XRk/xYM2olxsQYYtY6dOZgHU1gxoCyrWwtlTcb/ZV2TK8ZcTPzQmBqF/hWWQgV9Tcd WSoXdPZyd76GWTujVyRzRMcEvz58x3xziQ2s5o/j36qhgBjZuir2lBmBZMU+EwRX2G6O LO5M6iaVvvyLjtmkC9heK5BenHZb9G6DkqstB9U7S4jxuKBElMiHM7bcqGDoI9Py3kol ZkUlmg1BpIwe2YSSm9D1JFxulQ0Eq4Hb2DG9Hdwmn1lj9lngxrrVcWlGH9Tqsvz0sLVq n1OgFmtvDrCSM/uzr8irKz/J50FWYIrfkiHQS1dmPsXDAxcng9B1unCExmlNyiT5r2Wu 9nyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746739385; x=1747344185; h=content-transfer-encoding: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=f0zCShu//k6MfKAnEwLg/O3FZvluLuRQKnep4ZI0hDw=; b=T1Lok2O4l4G2Cee7OUfUecDABXn/p/35CJc4tAwMVScoPSFCLDrq1X2RBYeV6/ty0E 9c4tJFno4IVRLzlgWDtUrKTO0D1nnquo41WfsxJ1NihhKWZE4dQvLLinYKadI8gwn7bp OuHeUo+sbWKmR/LQ1mwVKT9Je+fkEPd1xAJjiSbDSwDaEj8wK9XHgfRI6B7hGa7UYlbm 7GP3hv5o1sL/Kcacd5ZLi2GF1jxmpDvnBmtkEFNYSPwB7SJ/ybkJNL3r+Tm0JI26Yg0y HmFqPIhNZMhAj/f++cSoOFCNts0J7O0YiIhKbYxvt6SZwAydqMqGi0uWOJoZLOlx6+Ty +qXA== X-Gm-Message-State: AOJu0YwxfWd8u3wdsKW6tJjD/UqWdq2NaUpZ9dtwjAbBk33i/qChm17S xFozTBgHnxXBPeqTB9L2Rt8cMcAMzrqpkpcjX2AlWmwcUuFEMewKiwrvKTcXLgdF2ik81YQdUXd vDNsXRkiPrrSRvgSXV4UKdKuvWF1Ec0I8ZBlvbg== X-Gm-Gg: ASbGncuY1s/dhu2IJZRI+rxL7iKXg11xcQbTgwMKX2FNDQOp3c14CGmApsdPfMHWm9a vYF5sbxN2Vnd93q1zrYLUN9D3QnOOiBjiDWrEQ39RErT2yw2WASQZcGvtlEIR5DX8CzEmHPOgel GtByaW7QMcWp2Lk9TU5cjcG+yOBJrAOFfsJ4Ty0abirESXtDdeiXssUzs= X-Google-Smtp-Source: AGHT+IFUiQ7Eq57qW9B+2QHn+Rmak99idYydV3rMCSOaM4ljzEGnNvOH3scXXK/BZ2DPQDioF8X4atvTbkTlcGLp4uU= X-Received: by 2002:ad4:5763:0:b0:6f5:3b8b:8d0d with SMTP id 6a1803df08f44-6f6e47fb1f0mr16454226d6.20.1746739384639; Thu, 08 May 2025 14:23:04 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <5eebf119-aeff-4d1e-8f84-0e91f7c89bb4@gmail.com> In-Reply-To: Date: Thu, 8 May 2025 23:22:53 +0200 X-Gm-Features: AX0GCFv5HR9y_UM-_dOdRqY-ib3rLmxHR6Jq61CTrzv5EBCNH4zt9-o-RNVhhLE Message-ID: Subject: Re: [PHP-DEV] Initial discussion - more deprecation options To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Daniel On Thu, May 8, 2025 at 5:48=E2=80=AFPM Daniel Scherzer wrote: > > So this example would emit deprecation warnings on all getting and settin= g operations, but I was thinking that they would *not* be emitted when bein= g accessed from within the same class (private scope). Consider a project t= hat > * does not want to use hooks (which add overhead) > * wants to support the deprecated behavior > > It would then want to > * emit warnings when a property is accessed by protected/public scope > * but need to handle any writes from outside of the class by accessing th= e property internally to see if the value changed > > I'm not sure what NAK means in this context, but I think that allowing `#= [\Deprecated]` directly on the property instead of needing to use hooks be = done in the same way that the property hooks were implemented in terms of d= ealing with VM handling and opcache, where things are not cached (I assume,= haven't looked into this enough, this is just a preliminary discussion). > > Allowing deprecation directly on properties would also be more performant= than needing to use hooks. I would echo what Niels said. Deprecations for internal functions were added before my time, and it made sense to expand this functionality to userspace, as the two should generally be congruent. I am not in favor of adding more runtime deprecations to hot code. Runtime deprecations are not a great solution in the first place, deprecations are much easier to catch through static analysis. Function deprecations made sense for us because we needed them internally, but I don't think we have a use-case for the properties. If they were trivial and free to add to runtime, I wouldn't mind as much. But they are neither of those things, in addition to being a bad solution to the original problem (reminding you to fix your code). Hence, I would prefer not adding more checks. Ilija