php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75844 An example generates a notice
Submitted: 2018-01-18 19:09 UTC Modified: 2018-01-18 19:25 UTC
From: jordi at enginydigital dot cat Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.0.27 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jordi at enginydigital dot cat
New email:
PHP Version: OS:

 

 [2018-01-18 19:09 UTC] jordi at enginydigital dot cat
Description:
------------
---
From manual page: http://www.php.net/language.references.pass
---

The statement in the docs -- New statements, i.e. foo(new foobar()) generates a notice since 7.0.7.

Notice: Only variables should be passed by reference

https://3v4l.org/RVcA3

Test script:
---------------
<?php

function foo(&$bar) {
    var_dump($bar);
}

class Bar {

}

foo(new Bar());



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-18 19:23 UTC] salathe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: salathe
 [2018-01-18 19:24 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=343850
Log: foo(new foobar()) raises a notice as of PHP 7.0.7 (doc bug #75844)

This is due to the fixing of #72038
 [2018-01-18 19:25 UTC] salathe@php.net
-Status: Assigned +Status: Closed
 [2018-01-18 19:25 UTC] salathe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Many thanks for suggesting your patch in the online documentation editor and for taking the trouble to create this bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 18:01:31 2024 UTC