arrowHome arrow Forum Wednesday, 27 August 2008  
Main Menu
Home
Media Gallery
J2EE Blog
Forum
News
Downloads
News Feeds
FAQ's
Links
System Status
Contact Us
About iDoumo
Latest Posts
Find suspicious files abukta
Automate Filesystem Dump abukta
Add route to server abukta
Benefits of Logical Volume Management abukta
Performance Costs of using LVM abukta
Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one

Newsflash
Developers at the Eclipse Project will soon be able to tap into Enterprise Java Beans (EJB) 3.0, thanks to a project spearheaded by Oracle.  Oracle said it is helping build an open source version of EJB 3.0's Object-Relational Mapping (ORM) tool under the Eclipse Public License. The platform focuses on design-time tooling and supports installation in any J2EE-compatible application server.

  iDoumo Projects
  Programming
        PHP 
              PHP Objects

Quick Jump To:

PHP Threads List - Search Forum
  Subscribe to this Thread
  PHP Objects
  20 Jan 2006 14:34 # 1 
   abukta
 super admin
 
 profile
 
Join Date: 29 Mar 2005 21:03
Posts:
 
 PHP Objects
An object is a compound data type that can contain any number of variables and functions. PHP's support for objects is very basic in Version 3. PHP Version 4 will improve the object-oriented capabilities of PHP. In PHP 3.0 the object-oriented support is designed to make it easy to encapsulate data structures and functions in order to package them into reusable classes. Here's a simple example:

Code:
class test {
var $str = "Hello World";
function init($str) {
$this->str = $str;
}
}

$class = new test;
print $class->str;
$class->init("Hello");
print $class->str;


This code creates a test object using the new operator. Then it sets a variable called str within the object. In object-speak, a variable in an object is known as a property of that object. The test object also defines a function, known as a method, called init( ). This method uses the special-purpose $this variable to change the value of the str property within that object.

If you are familiar with object-oriented programming, you should recognize that PHP's implementation is minimal. PHP3 does not support multiple inheritance, data protection (or encapsulation), and destructors. PHP does have inheritance and constructors, though.
 


<< Start < Prev 1 Next > End >>
Results 1 - 1 of 1



Help iDoumo

Help support "iDoumo" and free software by donating now!

Donate Once Monthly

Currency

Amount

Currency

Amount

Latest Events
There are no upcoming events currently scheduled.
View Full Calendar
Project Calendar
August 2008 September 2008
Su Mo Tu We Th Fr Sa
Week 31 1 2
Week 32 3 4 5 6 7 8 9
Week 33 10 11 12 13 14 15 16
Week 34 17 18 19 20 21 22 23
Week 35 24 25 26 27 28 29 30
Week 36 31
Media Gallery
Last update:
27 Sep, 11:53
Workday

random:

PeopleSoft
top of page

iDoumo Projects. All rights reserved.