For consistency I’m specifying return types since PHP 7.1, for all methods, including magic ones like __toString, and even when the implicit return type is void like with __unserialize(): When I try the same for constructors and destructors, like this: PHP yields Fatal errors: The only thing I can do right now is to specify the implicit return type in
Tag: php-7.1
When Generating URL Characters Being Arbitrarily Moved
Received this from a customer, our password reset emails normally generate correctly, however what (in code) looks like this:
server.’/password?email_token=…
2 dimensional associative array sorting with conditional statements in PHP
I’m having trouble figuring out how to solve this question, it’s from a free online test website. Here’s the link: https://www.testdome.com/questions/php/league-table/19939?questionIds=7278,19939&generatorId=30&type=fromtest&testDifficulty=Hard But to be clearer, I’m writing the question and my answer as well. The starting answer is there in the link written above. Question: The LeagueTable class tracks the score of each player in a league. After each game,
PHP7.1 mcrypt alternative
Mcrypt function has been deprecated as of PHP 7.1.0. My deprecated string encode / decode functions: $key: secret key $str: string $encoded = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($…