php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68804 Assign by ref operator is missing in precedence table
Submitted: 2015-01-12 03:28 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: sectus at mail dot ru Assigned:
Status: Open Package: Documentation problem
PHP Version: Irrelevant OS:
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: sectus at mail dot ru
New email:
PHP Version: OS:

 

 [2015-01-12 03:28 UTC] sectus at mail dot ru
Description:
------------
It seems that documentation is not clear about references. 

There is no mentioning about `assign by ref` operator(http://php.net/manual/en/language.operators.precedence.php). And its precedence is higher than `instanceof`. 

Also, there is exists mentioning of `left | & | bitwise and references`. What is a meaning of `references` in this line?

Test script:
---------------
$a = &$b instanceof stdClass;
$c =  $d instanceof stdClass;

// line     # *  op                   fetch          ext  return  operands
// -------------------------------------------------------------------------
//    3     0  >   ASSIGN_REF                               $0      !0, !1
//          1      FETCH_CLASS                          84  :1      'stdClass'
//          2      INSTANCEOF                               ~2      $0, $1
//          3      FREE                                             ~2
//    4     4      FETCH_CLASS                          84  :3      'stdClass'
//          5      INSTANCEOF                               ~4      !3, $3
//          6      ASSIGN                                           !2, ~4
//          7    > RETURN                                           1



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-20 21:40 UTC] cmbecker69 at gmx dot de
Related to #69091[1].

[1] <https://bugs.php.net/bug.php?id=69091>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC