[ create a new paste ] login | about

Link: http://codepad.org/aKc7LL2G    [ raw code | output | fork ]

PHP, pasted on Jul 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$array = array("playlist"=> 8002, "mp3"=>1024);

class Mix {
   public function __construct($array) {
    foreach($array as $key => $value) {
        $this->$key = $value;
      }
   }
}

$class = new Mix($array);
var_dump($class);


Output:
1
2
3
4
5
6
object(Mix)#1 (2) {
  ["playlist"]=>
  int(8002)
  ["mp3"]=>
  int(1024)
}


Create a new paste based on this one


Comments: