php-7.2

PHP 7.2 with mcrypt in Windows

こ雲淡風輕ζ 提交于 2019-11-29 21:47:27
问题 There are some huge legacy systems whose dependencies on PHPs' mcrypt are extremely important and vital (including the data storage in database). I need to find a way to maintain this library while upgrading to PHP 7.2 (which already worked fine). My local test environment is Windows. The live environment is run on CentOS. Some of the answers I have seen is decrypting and change mcrypt to openssl ( I think that's not possible at the moment since there's a lot of data to decrypt ). Another way

count() emitting an E_WARNING

纵然是瞬间 提交于 2019-11-29 14:09:29
问题 Prior to PHP 7.2 using count() on a scalar value or non-countable object would return 1 or 0 . For example: https://3v4l.org/tGRDE var_dump(count(123)); //int(1) var_dump(count(new stdclass)); //int(1) var_dump(count('hello world')); //int(1) var_dump(count(null)); //int(0) In the updates to PHP 7.2+, using count() as demonstrated above will emit a warning message. An E_WARNING will now be emitted when attempting to count() non-countable types (this includes the sizeof() alias function).

phpMyAdmin errors (count, blowfish, etc.) after php7.2 upgrade on Ubuntu 16

情到浓时终转凉″ 提交于 2019-11-29 02:24:00
phpMyAdmin errors after php7.2 upgrade After upgrading to php7.2 on Ubuntu 16.04 LTS, phpMyAdmin shows annoying popup warnings when I view tables: "Some errors have been detected on the server! Please look at the bottom of this window. Ignore All. Ignore." At the bottom of the window: " Warning in ./libraries/sql.lib.php#601 count(): Parameter must be an array or an object that implements Countable" ... followed by a long backtrace list. This problem occurs on various phpMyAdmin 4.x versions including and below 4.5.4. How do I fix this? Update - Blowfish error After upgrading to the newest

phpMyAdmin errors (count, blowfish, etc.) after php7.2 upgrade on Ubuntu 16

会有一股神秘感。 提交于 2019-11-27 16:36:25
问题 phpMyAdmin errors after php7.2 upgrade After upgrading to php7.2 on Ubuntu 16.04 LTS, phpMyAdmin shows annoying popup warnings when I view tables: "Some errors have been detected on the server! Please look at the bottom of this window. Ignore All. Ignore." At the bottom of the window: " Warning in ./libraries/sql.lib.php#601 count(): Parameter must be an array or an object that implements Countable" ... followed by a long backtrace list. This problem occurs on various phpMyAdmin 4.x versions

What does strict types do in PHP?

拟墨画扇 提交于 2019-11-27 00:19:11
问题 I've seen this new line in PHP7 but nobody really explains what it means. I've googled it and all they talk about is will you be enabling it or not like a poll type of thing. declare(strict_types = 1); What does it do? How does it affect my code? Should I do it? Some explanation would be nice. 回答1: From Treehouse blog : With PHP 7 we now have added Scalar types. Specifically: int, float, string, and bool. By adding scalar type hints and enabling strict requirements, it is hoped that more

What does question mark (?) before type declaration means in php (?int) [duplicate]

好久不见. 提交于 2019-11-26 23:20:50
问题 This question already has an answer here: Predefined types of variable parameters 4 answers I have seen this code in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/Output.php line number 40 they are using ?int. public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; $this->formatter = $formatter