php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69880 strict error
Submitted: 2015-06-18 22:54 UTC Modified: 2015-06-18 23:28 UTC
From: roberto at spadim dot com dot br Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.6.10 OS: linux
Private report: No CVE-ID: None
 [2015-06-18 22:54 UTC] roberto at spadim dot com dot br
Description:
------------
Hi guys, i received a strict error, but i`m confused what function received...

Why I'm receiving a variables should be passed by reference when i use t($a=1)? the t() function received 1, or the variable $a with value = 1?

Test script:
---------------
<?php
error_reporting(E_ALL);
function t(&$a){}

t($a=1); /// should not receive error!! t() received ($a=1)? or t received (1) without variable $a reference?
?>

[beto@conquista2 ~]# php t.php
PHP Strict Standards:  Only variables should be passed by reference in /home/beto/t.php on line 5

Strict Standards: Only variables should be passed by reference in /home/beto/t.php on line 5


Expected result:
----------------
no errors

Actual result:
--------------
PHP Strict Standards:  Only variables should be passed by reference in /home/beto/t.php on line 5


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-18 23:28 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-06-18 23:28 UTC] cmb@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 03:01:33 2024 UTC