Bug #74712 [NEW]: Now have to redeclare ticks on every file in PHP 7
| From: | hello at peterfeatherstone dot com | Date: | Thu, 08 Jun 2017 16:38:24 +0000 |
| Subject: | Bug #74712 [NEW]: Now have to redeclare ticks on every file in PHP 7 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209418@lists.php.net to get a copy of this message | ||
From: hello at peterfeatherstone dot com
Operating system: Ubuntu 17.04
PHP version: Irrelevant
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Now have to redeclare ticks on every file in PHP 7
Description:
------------
In PHP 5.6 it seems that adding declare(ticks=1) and then using
register_tick_function() would follow any includes and provide profiling
information accordingly.
In PHP 7+ however it now seems I have to add declare(ticks=1) in every
file. I use this for profiling every method call on a page load and
can't now add this to each PHP file in my system (If they are in
libraries etc.).
I can't find anything in the docs about changes that were made to this
or an alternative method for profiling every tick in the application.
Test script:
---------------
Replication code can be found here -
https://stackoverflow.com/questions/44440613/how-to-avoid-redeclaring-ticks-on-every-file-in-php-7?noredirect=1#comment75879747_44440613
Expected result:
----------------
Running php index.php I would expect to see 7
Actual result:
--------------
In PHP 5.6 I see 7 as expected
In PHP 7 I see 5
--
Edit bug report at https://bugs.php.net/bug.php?id=74712&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74712&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74712&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74712&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74712&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74712&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74712&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74712&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74712&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74712&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74712&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74712&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74712&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74712&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74712&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74712&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74712&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74712&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74712&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74712&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74712&r=mysqlcfg