RE: [PHP] Question regarding OOP and interitance

This is a discussion on RE: [PHP] Question regarding OOP and interitance within the PHP General forums, part of the PHP Programming Forums category; [snip] > FYI ... anything below PHP5 has a pseudo constructor. And how will it be in PHP5 ? [/snip] PHP5 will ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2003
Jay Blanchard
 
Posts: n/a
Default RE: [PHP] Question regarding OOP and interitance

[snip]
> FYI ... anything below PHP5 has a pseudo constructor.


And how will it be in PHP5 ?
[/snip]

PHP5 will be using the Zend 2 Engine, and gives a standard way of
declaring constructor methods by calling them by the name __construct().


An example from http://www.php.net/zend-engine-2.php

<?php
class BaseClass {
function __construct() {
print "In BaseClass constructor\n";
}
}

class SubClass extends BaseClass {
function __construct() {
parent::__construct();
print "In SubClass constructor\n";
}
}

$obj = new BaseClass();
$obj = new SubClass();
?>

True destructors will also be available, as should be true private
methods.
Reply With Quote
Reply


Thread Tools
Display Modes

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

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



All times are GMT +1. The time now is 05:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0