php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62790 Operator "->" missing in operator lists
Submitted: 2012-08-10 10:47 UTC Modified: 2013-10-24 08:58 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: matteosistisette at gmail dot com Assigned:
Status: Not a bug 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: matteosistisette at gmail dot com
New email:
PHP Version: OS:

 

 [2012-08-10 10:47 UTC] matteosistisette at gmail dot com
Description:
------------
Operator "->" (access of object properties and methods) is not listed either 
here:
http://www.php.net/manual/en/language.operators.php
nor here:
http://www.php.net/manual/en/language.operators.precedence.php


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-25 19:16 UTC] jschoett at gmail dot com
It's the so called "object operator" (T_OBJECT_OPERATOR), which is missing.
According to doc comment http://www.php.net/manual/en/language.operators.php#86566

Please fix this -- I really want to know which precedence this operator has!
 [2013-10-24 06:52 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-10-24 06:52 UTC] krakjoe@php.net
The question doesn't make any sense, closing the bug.
 [2013-10-24 08:58 UTC] matteosistisette at gmail dot com
@krakjoe Would you expand a little bit?
An operator is missing in the list that documents operator precedence, so there is no way to know what is the precedence of that operator compared to others.

What's the part that you don't understand? What doesn't make sense to you? Why should it be ok that the precedence of that operatos is not documented?
 [2013-10-24 09:08 UTC] matteosistisette at gmail dot com
Or do you need an example? Here it is:

  <?php
  class Test { 
    public $foo=1;
    public $bar=2;
    public $foobar="3";
  }
  $p1="foo";
  $p2="bar";
  $test=new Test();
  echo $test->$p1.$p2;

How is one supposed to know (other than by trying) that the output will be "1bar" and not "3"? (not to mention that it will produce a parse error prior to 5.0)
 [2013-10-24 09:10 UTC] matteosistisette at gmail dot com
(forget the part about the parse error; the rest is still valid)
 [2013-10-24 10:43 UTC] gabri dot ns at gmail dot com
even the array operator "[" is documented...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 10:01:31 2024 UTC