Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public final class Res()
- {
- const ARRAY = 1;
- const OBJECT = 0;
- private $dataType = null;
- public function setDataTypeIsArray()
- {
- $this->$dataType = self::ARRAY;
- }
- public function setDataTypeIsObject()
- {
- $this->$dataType = self::OBJECT;
- }
- public function setData()
- {
- if($this->$dataType === self::ARRAY)
- {
- // do something
- }
- else if($this->$dataType === self::OBJECT)
- {
- // do something
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement