ср, 23 янв. 2019 г. в 12:04, Jani Ollikainen <jani.ollikai...@valve.fi>:
> 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='PRE'; > $class='A'; > $method='B'; > $static='C'; > > $classVar=$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 = intval($var); > +$var = (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* :) -- Arvīds Godjuks +371 26 851 664 arvids.godj...@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius