Doc #75844 [Opn->Asn]: An example generates a notice
| From: | salathe@php.net | Date: | Thu, 18 Jan 2018 19:23:04 +0000 |
| Subject: | Doc #75844 [Opn->Asn]: An example generates a notice | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15345@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75844&edit=1
ID: 75844
Updated by: salathe@php.net
Reported by: jordi at enginydigital dot cat
Summary: An example generates a notice
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Documentation problem
Operating System: Any
PHP Version: 7.0.27
-Assigned To:
+Assigned To: salathe
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-01-18 19:09:00] 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());
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75844&edit=1