TICKS

PHP code

<?php
/*
 * 
 * opcode number: 105
 */
// A function that records the time when it is called
function profile()
{
   echo 
"profile function is called\n";
}

// Set up a tick handler
register_tick_function("profile");

// Initialize the function before the declare block
profile();

// Run a block of code, throw a tick every 2nd statement
declare(ticks=2) {
   for (
$x 0$x 10; ++$x) {
         echo 
"hello world\n";
   }
}
?>

PHP opcodes

Function name: (null)

Compiled variables: !0=$x

line#op fetchextreturn operands
70 NOP      
131 SEND_VAL     'profile'
 2 DO_FCALL  1  'register_tick_function'
163 DO_FCALL  0  'profile'
204 ASSIGN     !0,0
 5 IS_SMALLER   ~3 !0,10
 6 JMPZNZ  9  ~3,->13
 7 PRE_INC     !0
 8 JMP     ->5
219 ECHO     'hello+world%0A'
 10 TICKS     2
2211 TICKS     2
 12 JMP     ->7
 13 TICKS     2
2314 TICKS     2
2415 RETURN     1

Function name: profile

Compiled variables: none

line#op fetchextreturn operands
90 ECHO     'profile+function+is+called%0A'
101 RETURN     null
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top