Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103801 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25005 invoked from network); 23 Jan 2019 18:45:18 -0000 Received: from unknown (HELO mail-pf1-f174.google.com) (209.85.210.174) by pb1.pair.com with SMTP; 23 Jan 2019 18:45:18 -0000 Received: by mail-pf1-f174.google.com with SMTP id i12so1330518pfo.7 for ; Wed, 23 Jan 2019 07:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KyOB8rkRNrOrMCvH8431eQcR5kztOWh5Ege0Z71GyB0=; b=O6V9v1KHuKBS2JzgOU4XqBCGAnoEr+aRzKQMQYsdTULC/gRG0P3XWYXLafyCT7m9nn 5lWuWcY+sp2qAiqH79cYrIUZQMiXI61evLnsN3Yy4JnlI32eTcrvx5ttnqUA5K0H4jtQ WAG5phkG/iGyPVRkBHQTQbsuCFFyooEKFiEQEpAy4wPIjb8jr8TU1npMuSKqFr4Insbc RXmIckV5GQxX72f6oid82f0fImCGx/Buzih9qTa8z3tIJwx8bW43oxJ/AK5j/9Bp4MCt 5veIqGpNVwqVaLwYAdyuBWBlDskrCq1Uc6feJh1OfjfFTHFZhGpYXvY9+4idwG7QCEdu F7Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KyOB8rkRNrOrMCvH8431eQcR5kztOWh5Ege0Z71GyB0=; b=sDEeFFvSNu/D+TGCu5cSyJbd3yT4wWI2ginWHvs2IezLCQHCNm0WMiXCYLU6mjN2/D KaRKR8uzjiKgevwx/KZVM0rvVVnMJHlI4mtilxEzHX6ChVhfipYBF4HpNhtOKXnsle3t IBx/ZKfamOcSZywSm5wDZTUs48pdlj8NNYhK41GH/DXcFQltOY8UnIdqOTA0BFZfczOX Fiqp4Bvg3o5Sc1hS3G5dJm8srHOLa97rUFPAzYXjHX4F/PnFojxBCm2j6aQf60zb27R7 DfYwMfhfN0YuUL3aX7u4BpTmWBJAXysaBR98fByehWBuoPbXtYBzuYFR77b368bBLD0i +jJQ== X-Gm-Message-State: AJcUukdzy/lMtSu9vdHjFnoML/ikB+1X7Og9FZNLN/BPQ/OvzgGr2Rth i1J9UZueyikTq4mgUil6ayo3PX74YIOBomDqDfE0dQ== X-Google-Smtp-Source: ALg8bN4dE6CrS50t1CN83AnQmTnNZFR60vGWrxx1GSGGKw0O81N/bynBN3+/2w7qefxP+WJg5Vm1C9p7jlt2+pQ6vf8= X-Received: by 2002:a65:5387:: with SMTP id x7mr2321493pgq.412.1548256992234; Wed, 23 Jan 2019 07:23:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 23 Jan 2019 15:23:01 +0000 Message-ID: To: Girgias Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Deprecation ideas for PHP 8 From: Danack@basereality.com (Dan Ackroyd) On Tue, 22 Jan 2019 at 20:34, Girgias wrote: > > a list of functions which seem reasonable to deprecate > Classes/Objects functions: > > - is_a (use instanceof operator) This is a fundamentally bad idea. Functions can be passed around as functions, operators cannot be, which makes it easier to composite functionality together with functions than with operators. The main reason to use operators at all is to improve readability. i.e. `$x =3D $y + 2;` is easier to scan-read than `$x =3D plus($y, 2);` (and I'm not sure the instanceof operator actually achieves this aim.) but for when you want to be able to pass a function as a parameter, then functions are much more powerful. The same is true for floatval, intval etc. > Function handling functions: > > - call_user_func (invoke directly) > - call_user_func_array (arguments can be provided with the splat > operator (...) as of PHP 5.6 > - forward_static_call (same reason as call_user_func) > - forward_static_cal_array (same reason as call_user_func_array) > - func_get_arg (seems unnecessary as of PHP 5.6 with variadic function= s > (splat operator)) > - func_get_args (same reason as func_get_arg) > - func_num_args (same reason as func_get_arg) Please no. You're trying to set your preferred way of doing things as the only way of doing things. I strongly prefer to use the call_user_func versions and particularly call_user_func_array as they are clearer (imo) but also they are easier for people to search online for what they are doing. btw this RFC https://wiki.php.net/rfc/consistent_callables probably needs to be worked on before all the different ways of calling 'callables' is interchangeable anyway. > Filesystem aliases: > - is_writeable =E2=80=94 Alias of is_writable Shouldn't we stick with the one that is spelt correctly. /s Jani wrote: > The arguments why to deprecate didn't seem much more than, this maybe cou= ld be > deprecated. I think there should usually be some > benefits of deprecating, otherwise why not just leave it as it is? Seconded. Removing stuff that is working needs to have some justification, such as removing ongoing maintenance or it's actively harmful, rather than just we 'can' remove this. cheers Dan Ack