PHP Classes

File: read_only_property.php

Recommend this page to a friend!
  Classes of Artur Graniszewski   C# getters and setters in PHP   read_only_property.php   Download  
File: read_only_property.php
Role: Example script
Content type: text/plain
Description: Example: marks all properties with an underscore as the first letter of their names as a read-only
Class: C# getters and setters in PHP
Access class variables with setters and getters
Author: By
Last change:
Date: 12 years ago
Size: 215 bytes
 

Contents

Class file image Download
<?php

include("magic.php");

class
Test extends ReadOnly
{
    public
$_test = "This is a read only property";
}

ini_set('display_errors', 1);
error_reporting(E_ALL);

$x = new Test();
$x->_test = "aaa";