Booked Scheduler Community Support
February 26, 2020, 08:48:41 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: PHP 7 Notice: Only variables should be passed by reference  (Read 331 times)
bferris
Newbie
*

Karma: 0
Posts: 1


« on: July 09, 2019, 11:24:06 AM »

I've been using scheduler for a while and I just updated my server to PHP 7.3
It is working ok, but I'm getting tons of these PHP notices:

Notice: Only variables should be passed by reference in /var/www/math.local/docs/internal/booked/Domain/Access/ResourceRepository.php on line 77
Notice: Only variables should be passed by reference in /var/www/math.local/docs/internal/booked/Domain/Access/ResourceRepository.php on line 326
Notice: Only variables should be passed by reference in /var/www/math.local/docs/internal/booked/lib/Database/Commands/Commands.php on line 1389
Notice: Only variables should be passed by reference in /var/www/math.local/docs/internal/booked/Domain/Access/ResourceRepository.php on line 327

Digging into it, it looks like query function parameters (among others) are passed by reference but the parameter used when invoking the function uses the "new Object(...)" syntax. For example, in the DatabaseFactory Class, which requires a parameter passed by reference:
self::$_instance = new Database(new MySqlConnection($dbUser, $dbPassword, $hostSpec, $dbName));

It looks like this notice started as of PHP 7.0.7 (https://www.php.net/manual/en/language.references.pass.php)
foo(new Foobar()) // Produces a notice as of PHP 7.0.7
                           // Notice: Only variables should be passed by reference

I'm wondering if I should hack into it and fix this now or just ignore the notices/hope this will be updated at some point?

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!