in PHP, there is a declare construct.
declare(directive){ statements; }
this allow the directive work inside the block
declare(directive);
This allow the directive work in the entire script.
There is only one directive, which is ticks.
What does ticks do? ticks will run a function after every few "tick"(statement).
suppose you want to run something after every line of code.
function cool(){ echo 'cool'; } register_tick_function('cool'); declare(tick=1){ echo 'haha'; echo 'haha'; echo 'haha'; echo 'haha'; echo 'haha'; } output will be hahacoolhahacoolhahacoolhahacoolhahacool
What's the point of that function?
Because my first impression is: ZOMG some new crap I will never use! yeeah!
but soon i found it have a lot more use than just show off to people and piss them off. For instance:
Keep checking if a external stuff's status
Store how much memory used by each line
Anything you just don't want to be bothered to write once after each statement
in PHP, there is a declare construct.
declare(directive){ statements; }
this allow the directive work inside the block
declare(directive);
This allow the directive work in the entire script.
There is only one directive, which is ticks.
What does ticks do? ticks will run a function after every few "tick"(statement).
I have to get a new hosting. My site was down is because I don't have enough money for the hosting.
So I might have to use a very cheap $20 a year hosting...
So don't if the site is down again or something in this week you know I'm changing server and hosting.
Well, let me show you what I can do with my newest release of Imarty by doing one step at a time.
This is all the code you need
$imarty = new imarty('imagefile.xml');//get the XML file $imarty->render();//render image $imarty->output_image('gif');//out put gif image
First, let us create a image! Everything below is just changes of the imagefile.xml
<image w="20" h="20" cache=""> </image>
This defines the image's height and width, the cache system does not work yet but it will soon.
Introduction:
Dynamically call functions and methods can be used on making plugin systems where you send the same kind of data to a unknown function.
How to...
I suppose everyone knows how to dynamically call an function.
Suppose there are times you don't know what function you will call, you might want to express it into an array full of function names, and then use variable function system.
//This will be defined by a plugin writer $rand_func[] = 'rand'; $rand_func[] = 'mt_rand'; $key = array_rand($rand_func);
Recent comments
9 min 17 sec ago
16 min 57 sec ago
17 min 32 sec ago
18 min 20 sec ago
1 hour 38 min ago
1 hour 40 min ago
1 hour 42 min ago
2 hours 17 min ago
2 hours 18 min ago
2 days 19 hours ago