Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103792 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42350 invoked from network); 23 Jan 2019 13:37:20 -0000 Received: from unknown (HELO mail-wm1-f52.google.com) (209.85.128.52) by pb1.pair.com with SMTP; 23 Jan 2019 13:37:20 -0000 Received: by mail-wm1-f52.google.com with SMTP id b11so1398816wmj.1 for ; Wed, 23 Jan 2019 02:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3+ipoxvV4xxNQ0VtfFoILFB/1DOajIHiTJSNiQ09GI4=; b=AmNEXLSVGdz5UW4kmJcw2x6XVcBVz4hw3SGqUz0aeUWB5DcBNjQSqkDdVdl4xSMJ2/ WLl5TkqUbmGakz9V1v50IcX0ebHhqR7Frx9tHjTGS6RFL2tl49/8uQPX4RmCd1/YhBK7 Ldkb+VzUudRyjjegBotMrGJF2+1oPZ1pxsBO8beZpdniLSBEAvR/P2nbghsHgel3/xZm UEsM197a9YPkLALitHFaOAqg1YXVwLckWl1LQhvafQNrCQ/ZhYroiFCd9olVs+IK0841 4VG0pah9KR8Mgoa3fFgjc6epwEUL0P4j24y6wqxqmQ+AiBhv6SmUltbdvMj744a8M8lB pnZQ== 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; bh=3+ipoxvV4xxNQ0VtfFoILFB/1DOajIHiTJSNiQ09GI4=; b=PPLoDI8sAejV0af7Fuu0c6Z1K5HSKmFodX2g238jvcKCJaG3bi/5TJemBB6MeEL31k Iecc/I+cvMt07dT98F1q5N+unASmRWPQstzOhcsaUi7EUXSS7Jq8yoqJRfETYrKMq1VG 8WinH6YFwN7NSkvymY6TNkvxWFMorF7NwjgaCXn2Bh2i4qTJAp/MWzkFBw0lyZKV483l v+WjLEqiJ/uFv7AIMo4ZkSwds2nTIhjGMYxmMTQF7IO40M0anALLl2B/7JnBX7rgzKkM zHUQeoR6PgaCSc52ODmqLxEjE+Rg8fD8nR56VA5Do+byj5G+MQ72gs7rON8DIVhAUj9H FIWQ== X-Gm-Message-State: AJcUukfUtaapuZs1q5+Aipns4LmAuKkbJE9AS29BlwTZsDTbS+0bR9gk OmoNddaGxU5GkXuXPjgI6vgu7iX7siXZw5KBDTo= X-Google-Smtp-Source: ALg8bN5FzjNBidBPdx2ce0MqgOI+tMUEj241Xus4CK5sRz9g04tbP9Mcy7gQdnHznW20NMJuhBXz+i9SCLVtwk3rSBc= X-Received: by 2002:a1c:544f:: with SMTP id p15mr2085306wmi.37.1548238510893; Wed, 23 Jan 2019 02:15:10 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 23 Jan 2019 12:14:44 +0200 Message-ID: To: Jani Ollikainen Cc: Girgias , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="00000000000078328305801d5e88" Subject: Re: [PHP-DEV] Deprecation ideas for PHP 8 From: arvids.godjuks@gmail.com (Arvids Godjuks) --00000000000078328305801d5e88 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D1=81=D1=80, 23 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 12:04, Jani Ollika= inen : > Hi, > > The arguments why to deprecate didn't seem much more than, this maybe > could be deprecated. I think there should usually be some > benefits of deprecating, otherwise why not just leave it as it is? > > But some comments that I didn't notice in others. > > > - php_uname (use PHP_OS constant) > > PHP_OS is php_uname('s'), how about rest: > > mode > > mode is a single character that defines what information is returned: > > 'a': This is the default. Contains all modes in the sequence "s n > r v m". > 's': Operating system name. eg. FreeBSD. > 'n': Host name. eg. localhost.example.com. > 'r': Release name. eg. 5.1.2-RELEASE. > 'v': Version information. Varies a lot between operating systems. > 'm': Machine type. eg. i386. > > > > Classes/Objects functions: > > - is_a (use instanceof operator) > > - is_subclass_of (not exactly what it's purpose is but the instanceof > > operator SHOULD be a valid equivalence with another condition if the > same > > class must not be used) > > Both these have $allow_string > > > Function handling functions: > > - call_user_func (invoke directly) > > Yes, they give a little performance hit, but I still kind of like them. > Like if we think the following, I think I would prefer call_user_func for > syntax. > > class PREA { > public function AB() { > echo "HELLO".PHP_EOL; > } > public static function AC() { > echo "HELLOSTATIC".PHP_EOL; > } > } > > $prefix=3D'PRE'; > $class=3D'A'; > $method=3D'B'; > $static=3D'C'; > > $classVar=3D$prefix.$class; > > (new $classVar())->{$class.$method}(); > ($prefix.$class)::{$class.$static}(); > > call_user_func(array(new $classVar(), $class.$method)); > call_user_func($prefix.$class.'::'.$class.$static); > > And for the rest. Yes, there is another way of doing it, but is that > really enough for deprecating something? > > > Setting var type (can use variable casting nowadays): > > Yes, we can cast, but is this reason for make someone to go through all > the old code and do > -$var =3D intval($var); > +$var =3D (int) $var; > > > Hello to everyone. As a userland dev, I have to agree with Jani here - when I looked through the list of functions I had question marks all over the place about the `call_user_func*` family. Sure, closures are nice, but as demonstrated above they are not always the best-looking code and `call_user_func*` family has it's used. Maybe I'm just not using this functionality that much, so it seems like it's out of nowhere to deprecate/remove these for me= . is_writeable vs is_writable - the more you know *music* :) --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --00000000000078328305801d5e88--