Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113298 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38029 invoked from network); 27 Feb 2021 14:10:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Feb 2021 14:10:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CCF951804D1 for ; Sat, 27 Feb 2021 06:00:13 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 ; Sat, 27 Feb 2021 06:00:13 -0800 (PST) Received: by mail-wm1-f51.google.com with SMTP id i9so9265118wml.0 for ; Sat, 27 Feb 2021 06:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:mime-version:content-transfer-encoding:subject:to :from:message-id; bh=iHt6kpZYCpp7QHlQqElGOFz/C3pg0Mt9AFljon8zTP4=; b=qRifHxzS0yfGd8/amCQRZhWuz2IaIg8bVj7g/G6h78ecgTv6gbGH73LAC9G7BnAuuh CPR5F2xOFZ9IDLnqd+9eCbG2O6kw8DUotnxIhhjDEMbUOnvrMjqK4HBSohZHy4PqomJE TPAfUZ6x/nVe9Gh7IFQTOasudATab87O1bpIQ3an2KhLPmPN3NkcITKjH8s+A5KMt17I hq6m35cptYEG9y955KJxzOKfY0zMqlCzgt0yXSTlOs8W/tCbg1H1j2Pqg9HDht6grYsU 1LySqcm15KQ51OqYsea0Ixy8xhAwUjvRF4lbdTEvGg+ndBSVf7T8kKTm1d2GQ6/1KSaV vUQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=iHt6kpZYCpp7QHlQqElGOFz/C3pg0Mt9AFljon8zTP4=; b=qwtlyddbklwwv4blfmsOBGr9QNrqKA1YvogzdUh0PNy3k4hN/fioQClyy5YeAHGgVm nwZMNZvnxOjstuqE1/c8CSLMarZskKDF8LRkzibzLX2QRNmCJogvZity3lPskBYtcv8m JY0YsnLIe9YmL3+WwEBFyZBG/qGnshKMq9gfCW4SdJkeENV3+zlap6Ebq7dcKY/Nu4PG Rqfln+J3uwBSgev4hFSTPNA8qKEOTfdW5H9D/ro96p7Tj+QyC4quGlC9GdaIoisfOM/N Yw/G9eOjc5Z3EVCYlaROS1VWPzOlbmuQyhaoo0NxWXZvc3087QdBxloJeqMEmAfs7tiA XVng== X-Gm-Message-State: AOAM532nfSbL0hlQdVenZQJIvIEu+kiIqnPf8Dy6N87tSHe65UtOmlLN ChonrYTp9jYkYkGejmWnKrfPjME+AuI= X-Google-Smtp-Source: ABdhPJxKEAiXIwHcOrdmiVMAXGsnjC7UB87r5tJ5RquLzc/MPtUUSMZNwmGk9cq8Hv7Wlh0lNEJbgg== X-Received: by 2002:a05:600c:3511:: with SMTP id h17mr7553223wmq.2.1614434411037; Sat, 27 Feb 2021 06:00:11 -0800 (PST) Received: from [192.168.0.27] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id b15sm18105667wrr.47.2021.02.27.06.00.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Feb 2021 06:00:10 -0800 (PST) Date: Sat, 27 Feb 2021 14:00:12 +0000 User-Agent: K-9 Mail for Android MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----47JAKHG2Z8N8M8QIAGCFJ5C0WNLER2" Content-Transfer-Encoding: 7bit To: internals@lists.php.net Message-ID: <62243527-96EC-4234-AD50-EDB6333628D5@gmail.com> Subject: Deprecate debug_zval_dump? From: rowan.collins@gmail.com (Rowan Tommins) ------47JAKHG2Z8N8M8QIAGCFJ5C0WNLER2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, I would like to propose we formally deprecate the function debug_zval_dump= and remove it in PHP 9=2E0=2E This function is mostly similar to var_dump, with the additional ability t= o output the refcount of a variable=2E This has always been hard to interpr= et, but is now so complex as to be effectively useless: - Because it is implemented as a function taking a parameter in the normal= way, the refcount has been modified by the time it is displayed=2E Dependi= ng on the value passed, this may include reference separation; in older ver= sions of PHP, it was possible to affect this directly by forcing a pass-by-= reference=2E The manual still discusses this, but it hasn't been possible s= ince PHP 5=2E4=2E [1] - Since PHP 7, some types don't have a refcount at all, and references are= represented by additional levels of zval=2E Without completely changing th= e output format, this information is impossible to convey accurately=2E - Optimisations affect the refcount in increasingly non-obvious ways=2E Fo= r instance, an array defined literally in the source code has an extra coun= ted reference compared to one which has been modified at runtime=2E [2] Since this is a rather specialised piece of debugging information, not use= ful to the average user, I think it should be left to dedicated debugging t= ools=2E XDebug includes an equivalent function that takes a name and looks = it up in the symbol table, avoiding some of the worst issues [3]=2E I'm not= familiar with PHPDBG, and it doesn't seem to have much documentation, but = I assume it would be able to display this as well=2E I notice there's a draft for an omnibus "deprecations for PHP 8=2E1" RFC [= 4]=2E Should I add this there, or raise a separate RFC? Refs: 1: https://www=2Ephp=2Enet/debug-zval-dump 2: https://3v4l=2Eorg/DVi3f 3: https://xdebug=2Eorg/docs/all_functions#xdebug_debug_zval 4: https://wiki=2Ephp=2Enet/rfc/deprecations_php_8_1 Regards, --=20 Rowan Tommins [IMSoP] ------47JAKHG2Z8N8M8QIAGCFJ5C0WNLER2--