Bug #72214 [Nab->Ver]: variables doesn't passed node

From: Date: Fri, 13 May 2016 18:07:03 +0000
Subject: Bug #72214 [Nab->Ver]: variables doesn't passed node
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201076@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72214&edit=1 ID: 72214 Updated by: requinix@php.net Reported by: schumacher1986 at hotmail dot com Summary: variables doesn't passed node -Status: Not a bug +Status: Verified Type: Bug Package: Scripting Engine problem Operating System: windows PHP Version: 7.0.7RC1 Block user comment: N Private report: N New Comment: Actually I just remembered that PHP 7 came with a reclassification of some strict warnings. The one I'm talking about was a strict before and a notice now. https://wiki.php.net/rfc/reclassify_e_strict#only_variables_should_be_passed_by_reference Just tried with 7.0.7RC1 too and I can confirm the message is appearing when it did not in 7.0.6. Here's the thing: every expression used as a by-ref argument triggered the strict/notice message before - except for new objects. That code was actually working fine before. But I'm more inclined to see that exception as a bug and this change in behavior a bug fix; there would be new notices popping up but code would continue to work. So even though I'm switching this to Verified, it may not be a bug after all. Or maybe its fix is postponed until 7.1. Previous Comments: ------------------------------------------------------------------------ [2016-05-13 17:40:31] matias at avusto dot fi Believe me, I have error_reporting = E_ALL in all of the PHP versions I've installed (using phpbrew). I'm just saying as Joomla has likely thousands of developers who have never seen this error before. I haven't tried PHP 7.0.7 builds yet, but I can say that there are no errors in the log files when I'm using PHP 7.0.6 (or any PHP version I've used in the past). ------------------------------------------------------------------------ [2016-05-13 17:22:26] requinix@php.net Never *shown* it before. Your PHP 5 setup probably had notices suppressed. ------------------------------------------------------------------------ [2016-05-13 17:18:58] matias at avusto dot fi Its not a bug in PHP, though I have no idea why PHP never had the notice shown before. class JAdminCssMenu extends JObject { public function addChild(JMenuNode &$node, $setCurrent = false) { ... } ... } vs call to it: $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')); Only variables can be passed to the function as the first parameter and what is passed is certainly not a variable. ------------------------------------------------------------------------ [2016-05-13 14:59:00] requinix@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2016-05-13 14:57:14] schumacher1986 at hotmail dot com Description: ------------ With the 7.0.7 RC1 i get Notice: Only variables should be passed by reference testing instruction: Install Joomla. Change php version to 7.0.7 RC1 On the backend you getting a lot of notices. Looks like the variables doesn't parsed correct anymore. Test script: --------------- public function __construct() { $this->_root = new JMenuNode('ROOT'); $this->_current = & $this->_root; } $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72214&edit=1

« previous php.bugs (#201076) next »