|  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
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: pluggz24 at yahoo dot com
New email:
PHP Version: OS:


 [2003-10-11 16:07 UTC] pluggz24 at yahoo dot com
a sample script/output demonstrating/explaining this bug can be found here:

Reproduce code:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-12 20:52 UTC]
See bug #12247

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 09:01:29 2024 UTC