In javascript, var myStringToArray = myString.split(”); is perfectly acceptable. But in PHP, $My_String_To_Array = explode(”, $My_String); throws an error: Warning: explode() Empty delimiter …
Tag: php-7
mcrypt is deprecated, what is the alternative?
The mcrypt-extension is deprecated will be removed in PHP 7.2 according to the comment posted here. So I am looking for an alternative way to encrypt passwords. Right now I am using something like I need your opinion for the best/strongest way to encrypt passwords, the encrypted password should of course supported by PHP 7.xx and should also be decryptable
PHP 7 inconsistently throwing errors for division by zero
I am currently trying to understand the behavior of the new error handling in PHP 7. In the PHP Documentation for DivisionByZeroError, it states: DivisionByZeroError is thrown when an attempt is made to divide a number by zero. Fair enough, but it does not throw the DivisionByZeroError when the / operator is used. In this example, I would expect both
What happens with set_error_handler() on PHP7 now that all errors are exceptions?
On PHP5 it makes a whole lot of sense having both set_exception_handler() and set_error_handler() defined. However, on PHP7 all (most?) errors are now exceptions. So, what’s the point on defining …
Class SimpleXMLIterator not found in zend framework 1 when zf create project ZendApp with PHP7
I downloaded this zend framework zf 1.12.20 from their official site Unzipped it and added the path to library in php.ini and aliased bin/zf.sh in .bashrc as per this tutorial Now when I do zf create project ZendApp, I get the following error: I tired by relocating the framework to my home folder but the error didn’t resolve. I tried
Type hinting in PHP 7 – array of objects
Maybe I missed something but is there any option to define that function should have argument or return for example array of User objects? Consider the following code: <?php class User { …
Nullable return types in PHP7
PHP 7 introduces return type declarations. Which means I can now indicate the return value is a certain class, interface, array, callable or one of the newly hintable scalar types, as is possible for …