Skip to content

Code for PHP you can create your class by array; patch stdClass can not contain dynamic functions.

Notifications You must be signed in to change notification settings

adolphZhao/DynamicClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

DynamicClass

Code for PHP

you can create your class by array;

patch stdClass can not contain dynamic functions.

#example

<?php

$cls = Request::map(
[
	'send'=>function (){
		$props = get_object_vars($this);
        	foreach($props as $n => $v){
                	echo $n.'='.$v."\n";
        	}
	},
	'echo'=>function (){
		 $this->send();
	},
	'sex'=>'Famale',
	'id'=>'100'
]);

About

Code for PHP you can create your class by array; patch stdClass can not contain dynamic functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages