Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3606508
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:15:26+00:00 2026-05-18T21:15:26+00:00

i was following an ACL tut. which has used this piece of code. class

  • 0

i was following an ACL tut. which has used this piece of code.

class ACL
{
    var $perms = array();
    var $userID = 0;
    var $userRoles = array();

    function __constructor($userID = '')
    {

    }
}

however i am unable to understand some of the above declarations.

a) the class property is declared starting with var keyword in the above class, in data encapsulation is it not necessary we use public,private, or protected keywords before the declaration of the property.? is the above method meant for PHP4 ? or will it work for php5 too?

b) my IDE(Panic Coda). takes __construct as the correct syntax for constructor. the above code has used __constructor . which one is correct ? to my knowledge in PHP4 the constructor name should be the same as class name if that is the case then is __construct and __constructor one and the same in PHP5?

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:15:26+00:00Added an answer on May 18, 2026 at 9:15 pm

    a) The var keyword is indeed probably meant for PHP 4 compatibility. var is equivalent with PHP 5’s public. It will work in PHP 5 as well, but seeing as PHP 4’s time has passed, it is safe to move on to public, private, and protected.

    b) __construct, or the name of the class for a PHP 4 compatible declaration, is the only correct way. __constructor() will not declare a constructor method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following code produces a nested array as a result for keys containing three items:
Following code worked fine abstract class FunctionRunnable<V> implements Runnable { protected abstract V calculate();
Following leads in this thread and others, I've set up a code block where
I am using third party server which return me following things. 1)url 2)acl 3)policy
I am following this cake php acl model article to create my own acl
Consider following code: $acl = new Phalcon\Acl\Adapter\Memory(); $acl->setDefaultAction(Phalcon\Acl::DENY); //Register roles $acl->addRole(new Phalcon\Acl\Role('guest')); $acl->addRole(new Phalcon\Acl\Role('member',
Following this entry in the cookbook, the ACL system is easy to implement for
I am doing this in my code <?php class Model_LibraryAcl extends Zend_Acl { public
I'm following this ACL tutorial here and I noticed that the aros_acos table contains
i want to build an ACL system for my application which have the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.