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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: roberto at spadim dot com dot br
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Dec 12 15:01:32 2024 UTC