By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

Class variable declarations: public/private/protected

P: n/a
<?php
class myClass
{
var $myVar;
..
..
}
?>

In php.ini I have error_reporting = E_ALL | E_STRICT
The above code is causing the following error/notification in my Apache
logs:-

"PHP Strict Standards: var: Deprecated. Please use the
public/private/protected modifiers."

Searching in the most current .chm help finds very little, indeed the
class definition examples still use var.

I understand the reason for the warning, what I don't have is a scope
definition for public, private and protected nor an explicit definition
of how to use the modifiers.

Any help on the above would be appreciated.

Steve.

--
PHP 5.0.4 Apache 2.0.54 Win2K/SP4
If you must reply by email, remove the DOT's first...
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Screwball" <sc**********@blueyonderDOT.coDOT.uk> a écrit dans le message de
news: B2*****************@text.news.blueyonder.co.uk...
<?php
class myClass
{
var $myVar;
.
.
}
?>

In php.ini I have error_reporting = E_ALL | E_STRICT
The above code is causing the following error/notification in my Apache
logs:-

"PHP Strict Standards: var: Deprecated. Please use the
public/private/protected modifiers."

Searching in the most current .chm help finds very little, indeed the
class definition examples still use var.

I understand the reason for the warning, what I don't have is a scope
definition for public, private and protected nor an explicit definition
of how to use the modifiers.

Any help on the above would be appreciated.

Steve.

--
PHP 5.0.4 Apache 2.0.54 Win2K/SP4
If you must reply by email, remove the DOT's first...

Hi, every things here :
http://www.php.net/manual/en/languag...visibility.php
Jul 17 '05 #2

P: n/a
(¯`·..Yttrium ...·´¯) wrote:
"Screwball" <sc**********@blueyonderDOT.coDOT.uk> a écrit dans le message de
news: B2*****************@text.news.blueyonder.co.uk...
<?php
class myClass
{
var $myVar;
.
.
}
?>

In php.ini I have error_reporting = E_ALL | E_STRICT
The above code is causing the following error/notification in my Apache
logs:-

"PHP Strict Standards: var: Deprecated. Please use the
public/private/protected modifiers."

Searching in the most current .chm help finds very little, indeed the
class definition examples still use var.

I understand the reason for the warning, what I don't have is a scope
definition for public, private and protected nor an explicit definition
of how to use the modifiers.

Any help on the above would be appreciated.

Steve.

--
PHP 5.0.4 Apache 2.0.54 Win2K/SP4
If you must reply by email, remove the DOT's first...


Hi, every things here :
http://www.php.net/manual/en/languag...visibility.php


Brilliant - thank you.

Would be nice if public, private and protected were keywords in the
index though - I never thought of "visibility" :o

--
Steve.
If you must reply by email, remove the DOT's first...
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.