PHP Classes

File: test1.php

Recommend this page to a friend!
  Packages of Salvan Grégory   Namespaces   test1.php   Download  
File: test1.php
Role: Example script
Content type: text/plain
Description: required file for example
Class: Namespaces
Load classes from defined namespaces
Author: By
Last change: access
Date: 17 years ago
Size: 462 bytes
 

 

Contents

Class file image Download
<?php
echo "<p>file test1.php was loaded</p>";
class test {
    private $obj;
    function test() {
        $this->obj= new test1();
        echo "<p>new object of class 'test' from file 'test1.php' created</p>";
    }
    
    public function sh() {
        $this->obj->show();
    }
}
class test1 {
    private $text;
    function test1(){
        $this->text= "<p>new object of class 'test1' from file 'test1.php' created</p>";
    }
    public function show() {
        echo  $this->text;
    }
}
?>