Due to an implementation bug, the declare(ticks=1) directive leaked into different compilation units prior to PHP 7.0. This is not how declare() directives, which are per-file or per-scope, are supposed to work.

Therefore there are different implementations between PHP 5.6 and the correct implementation has been added in PHP 7.0. This means the below script will return different results

1) PHP has encountered an Unhandled Exception Code -1073741674 at 0435EC5A2) PHP has encountered an Access Violation at 027278913) PHP has encountered an Access Violation at 027278794) PHP has encountered an Access Violation at 00000000

So far the code hasn't crashed the web server, but like the warning says, "register_tick_function() should not be used with threaded web server modules. Ticks are not working in ZTS mode and may crash your web server."

Strangely enough, the code does execute successfully every once in a while.