php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25841 ternary returns by-value rather than by-reference, although if/else works fine
Submitted: 2003-10-11 16:07 UTC Modified: 2003-10-12 20:52 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: pluggz24 at yahoo dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.2 OS: Slackware Linux 8.1, Windows XP
Private report: No CVE-ID: None
 [2003-10-11 16:07 UTC] pluggz24 at yahoo dot com
Description:
------------
a sample script/output demonstrating/explaining this bug can be found here:

http://republic.acmeshells.com/~plugged/ternary_bug.txt

Reproduce code:
---------------
http://republic.acmeshells.com/~plugged/ternary_bug.txt

Expected result:
----------------
test using if/else:
  $b->var:      hi
  $a->var->var: hi

test using ternary:
  $b->var:      hi
  $a->var->var: hi

Actual result:
--------------
test using if/else:
  $b->var:      hi
  $a->var->var: hi

test using ternary:
  $b->var:      hi
  $a->var->var: hello

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-12 20:52 UTC] sniper@php.net
See bug #12247

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 12:01:28 2024 UTC