🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Community Projects
    • Live Sessions
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Community Projects Live Sessions Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
  • Caio Ferrari
    Caio Ferrari
    5,455 Points

    Is "__construct" a default value?

    Posted April 1, 2016 3:50am by Caio Ferrari
    Caio Ferrari
    5,455 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • Hossein Jalali
    Hossein Jalali
    5,658 Points

    Getting the default value

    Posted January 10, 2016 7:16pm by Hossein Jalali
    Hossein Jalali
    5,658 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    2 Answers

  • Mayur Pande
    PLUS
    Mayur Pande
    Courses Plus Student 11,711 Points

    How comes instance variables (properties) are public?

    Posted November 12, 2015 11:18am by Mayur Pande
    Mayur Pande
    Courses Plus Student 11,711 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    2 Answers

  • ammarkhan
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points

    $this in constructor

    Posted November 8, 2015 7:20pm by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    0 Answers

  • Ezekiel dela Peña
    Ezekiel dela Peña
    6,231 Points

    For Clarification (don't look here if you haven't answered the last quiz for this class)

    Posted September 14, 2015 6:42am by Ezekiel dela Peña
    Ezekiel dela Peña
    6,231 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • William J. Terrell
    William J. Terrell
    17,403 Points

    Encountering several errors...

    Posted September 9, 2015 4:49pm by William J. Terrell
    William J. Terrell
    17,403 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    3 Answers

  • Kim Gee
    Kim Gee
    3,841 Points

    getInfo()

    Posted August 25, 2015 5:45pm by Kim Gee
    Kim Gee
    3,841 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    2 Answers

  • narvesh pradhan
    narvesh pradhan
    2,958 Points

    why this

    Posted August 10, 2015 5:53am by narvesh pradhan
    narvesh pradhan
    2,958 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • Luis Alveiro Martinez Botello
    Luis Alveiro Martinez Botello
    2,726 Points

    My code is not been showed

    Posted June 19, 2015 3:19am by Luis Alveiro Martinez Botello
    Luis Alveiro Martinez Botello
    2,726 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • MUZ140920 Kudakwashe Murungu
    MUZ140920 Kudakwashe Murungu
    6,316 Points

    Constructor Method - Code not showing output as shown by Hampton

    Posted June 13, 2015 8:49pm by MUZ140920 Kudakwashe Murungu
    MUZ140920 Kudakwashe Murungu
    6,316 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    3 Answers

  • Yan Liu
    Yan Liu
    10,552 Points

    Help for Constructor Method

    Posted April 24, 2015 8:14am by Yan Liu
    Yan Liu
    10,552 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • SERGIO RODRIGUEZ
    SERGIO RODRIGUEZ
    17,532 Points

    How do I set default values to properties that where not specified during the instance creation?

    Posted February 5, 2015 9:23pm by SERGIO RODRIGUEZ
    SERGIO RODRIGUEZ
    17,532 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    3 Answers

  • Ben Anggoro
    Ben Anggoro
    36,161 Points

    More OOP PHP Please...

    Posted June 2, 2014 6:00pm by Ben Anggoro
    Ben Anggoro
    36,161 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    2 Answers

  • adam mashburn
    adam mashburn
    193 Points

    basic ideas

    Posted April 8, 2014 12:02am by adam mashburn
    adam mashburn
    193 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

  • Paul Mather
    Paul Mather
    3,313 Points

    OOP Construct Method - code incorrect?

    Posted March 19, 2014 12:06am by Paul Mather
    Paul Mather
    3,313 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    3 Answers

  • ammarkhan
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points

    Arguments in construct

    Posted March 11, 2014 8:31am by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • PHP
    • Object-Oriented PHP Basics (Retired)
    • Properties and Methods
    • Constructor Method

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.