Skip to content

Tag: php-7

Variable variables in classes using PHP 7

Actually I’m migrating a bigger project from PHP 5.3.3 to PHP 7.1.13. In older versions of PHP it was possible to code following access to variable variables: This shows: Using the same code in PHP 7 it shows: In PHP 7 I figured out, that I have to use this way to get the same result: I found in the

PHP binding method to another class

Can i bind method of class Foo to class Bar? And why the code below throws a warning “Cannot bind method Foo::say() to object of class Bar”? With function instead of method code works fine. P.S. I know about extending) it is not practical question, just want to know is it real to bind non-static m…

usort difference php7.1 vs php5.6

I’m currently migrating a project from php5.6 to php7.1. Most is going well, but I just hit a wall on a test. The function usort doesn’t have the same behavior on both version, and it doesn’t seem to be documented (it’s not that two values are equals and then the order is undefined). I…