PHP Basics

OverloadingSetter

Overloads a class with writable magic properties.

Internally it writes the protected $_data array whose keys are interpreted as property names.

Example: Foo->bar = 42; will set $_data['bar'] to 42.

Tags
author

Sebastian Meyer sebastian.meyer@opencultureconsulting.com

Table of Contents

Methods

__set()  : void
Write data to an overloaded property.
__unset()  : void
Unset an overloaded property.

Methods

__set()

Write data to an overloaded property.

public __set(string $property, mixed $value) : void
Parameters
$property : string

The class property to set

$value : mixed

The new value of the property

__unset()

Unset an overloaded property.

public __unset(string $property) : void
Parameters
$property : string

The class property to unset


        
On this page

Search results