Connecting Tech Pros Worldwide Help | Site Map

Class variable declarations: public/private/protected

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:55 PM
Screwball
Guest
 
Posts: n/a
Default Class variable declarations: public/private/protected

<?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...

  #2  
Old July 17th, 2005, 12:55 PM
\(¯`·..Yttrium ...·´¯\)
Guest
 
Posts: n/a
Default Re: Class variable declarations: public/private/protected


"Screwball" <screwball127@blueyonderDOT.coDOT.uk> a écrit dans le message de
news: B2qce.21816$G8.6456@text.news.blueyonder.co.uk...[color=blue]
> <?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...[/color]


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


  #3  
Old July 17th, 2005, 12:55 PM
Screwball
Guest
 
Posts: n/a
Default Re: Class variable declarations: public/private/protected

(¯`·..Yttrium ...·´¯) wrote:[color=blue]
> "Screwball" <screwball127@blueyonderDOT.coDOT.uk> a écrit dans le message de
> news: B2qce.21816$G8.6456@text.news.blueyonder.co.uk...
>[color=green]
>><?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...[/color]
>
>
>
> Hi, every things here :
> http://www.php.net/manual/en/languag...visibility.php
>
>[/color]

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...
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.