php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #42285 var visibility docs are hidden
Submitted: 2007-08-13 14:38 UTC Modified: 2010-07-28 02:15 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: x12code at yahoo dot com Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: XP SP2
Private report: No CVE-ID: None
 [2007-08-13 14:38 UTC] x12code at yahoo dot com
Description:
------------
The following page mentions "classes":

http://us.php.net/manual/en/language.oop.php

I am learning PHP. I went through an online tutorial and am now reading through the manual as I am lead page by page. On this page I came across new syntax not seen before which is the "var statement". This appears different than other variable declaration, which is just to type the variable name on a line with no assignment, or just use the variable for the first time. Wanting to be sure what this means I read previous manual pages on php.net again, I searched php.net, and I did an internet wide google search. I feel I have come to understand the "var statement", but doing so was difficult. It was not expressly stated in the manual. Searching is difficult because "var" is quite ambiguous to "variable" for both PHP and Javascript, and php.net uses "$var" for some code examples. Thanks

Reproduce code:
---------------
n/a

Expected result:
----------------
n/a

Actual result:
--------------
n/a

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-16 08:42 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2010-03-29 11:37 UTC] rjmunro at arjam dot net
The documentation for the var statment is still impossible to find. I have no idea what it means - the only relevant hit from searching php.net for "var statement" is this bug report. 

If I go to http://php.net/var, it takes me to http://php.net/manual/en/book.var.php, which is titled "Variable handling" and should presumably contain the information, but doesn't contain the string "var " in it's entire contents. So far I can't find what var means.
 [2010-03-29 22:43 UTC] philip@php.net
-Status: Closed +Status: Open
 [2010-03-29 22:43 UTC] philip@php.net
Note: 'var' is a synonym for 'public' in OOP.

Because 'var' is not deprecated (nor an E_STRICT error as 5.1.3), it could be 
treated with a little more  respect.

The OOP4 documentation refers to 'var' although doesn't really speak of it in 
specific terms. That's okay  though, PHP 4 is dead and not worth updating.

The general OOP documentation however has a note about 'var' no longer emitting an 
E_STRICT error, but since it's not deprecated we may as well mention it outside of 
the note too. How far  should we go? Probably not far, but farther than we do 
today.

Also, php.net/var should go somewhere useful.

Thanks to Yawk for opening discussion on this bug report.
 [2010-04-17 15:15 UTC] derick@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: philip
 [2010-07-28 02:13 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=301628
Log: Added a var redirect to the oop5 docs; closes PHP bug #42285
 [2010-07-28 02:15 UTC] philip@php.net
-Summary: var statement +Summary: var visibility docs are hidden -Status: Assigned +Status: Closed
 [2010-07-28 02:15 UTC] philip@php.net
After further thought, it's okay as a second class citizen. However, php.net/var 
will redirect to the appropriate docs once the php.net mirrors sync. Thanks for 
the bug report :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 11:01:33 2024 UTC