php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71964 Pass by reference variable modification fails under certain circumstance
Submitted: 2016-04-05 09:27 UTC Modified: 2016-04-05 11:07 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ben dot davies at gmail dot com Assigned: laruence (profile)
Status: Closed Package: Variables related
PHP Version: 7.0.5 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ben dot davies at gmail dot com
New email:
PHP Version: OS:

 

 [2016-04-05 09:27 UTC] ben dot davies at gmail dot com
Description:
------------
It appears that assigning variables passed by reference does not work under specific circumstances. 
For example in the test script, removing the switch statement in the `bug` function does not trigger the bug.

Having a look around recent bug fixes, this is possibly a regression introduced by https://bugs.php.net/bug.php?id=71756.

The test script only fails on php 7.0.5

Test script:
---------------
https://3v4l.org/KB4sC

Expected result:
----------------
string

Actual result:
--------------
@string@

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-05 11:07 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2016-04-05 11:07 UTC] laruence@php.net
this has been fixed in #71914
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 01:01:26 2025 UTC