473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ticks, debug_backtrace, PHP5

I couldn't find it mentioned anywhere, so just in case someone else
should run into this.

Function arguments in the result from "debug_backtrace" or
"debug_print_backtrace", when called from a registered tick_function,
is out of sync.

I couldn't find an exact match at bugs.php.net, but assume the bug
overlaps with this one. http://bugs.php.net/bug.php?id=29896

According to the change log, it should have been fixed from version
5.1.0, so if your web host or distro is not up to speed, kick and yell
and/or upgrade, whatever works or makes you feel better.

I checked on a windows(cli), perhaps someone with Linux and PHP>=5.1
can check it before I get around to upgrading mine (wink wink nudge
nudge).

To check:...

<?php
header('Content-Type: text/plain');

function sub1($str) {
return sub2("$str world");
}

declare(ticks=1) {
function sub2($str1) {
; //tick here
echo __FUNCTION__, ':', PHP_EOL;
debug_print_backtrace();
return "\n\n$str1\n\n";
}
}

register_tick_function('__tick_function');
echo sub1('Hello');

function __tick_function() {
echo __FUNCTION__, ':', PHP_EOL;
debug_print_backtrace();
echo '------------------', PHP_EOL;
unregister_tick_function(__FUNCTION__);
}
?>
This is how the trace output looks on a PHP 5.0.4:...

__tick_function:
#0 __tick_function() called at [.../ticks_and_backtrace.php:10]
#1 sub2() called at [.../ticks_and_backtrace.php:10]
#2 sub2() called at [.../ticks_and_backtrace.php:5]
#3 sub1(Hello world) called at [.../ticks_and_backtrace.php:18]
------------------
sub2:
#0 sub2(Hello world) called at [.../ticks_and_backtrace.php:5]
#1 sub1(Hello) called at [.../ticks_and_backtrace.php:18]

.... and how it should look...

__tick_function:
#0 __tick_function() called at [...\ticks_and_backtrace.php:10]
#1 sub2(Hello world) called at [...\ticks_and_backtrace.php:5]
#2 sub1(Hello) called at [...\ticks_and_backtrace.php:18]
------------------
sub2:
#0 sub2(Hello world) called at [...\ticks_and_backtrace.php:5]
#1 sub1(Hello) called at [...\ticks_and_backtrace.php:18]
/Bent
Jan 21 '06 #1
0 1164

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Num | last post by:
Hi all, I have to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks") In Java, currentTimeMillis, is the difference, measured in milliseconds, between the current time...
6
by: Michael Riggio | last post by:
Does anyone know a way to get system ticks in .Net? I found DateTime.Ticks, but that is equal to 100 nanoseconds. The reason I'm asking is because we're considering passing some sort of timestamp...
4
by: Jeroen CEuppens | last post by:
Hi, I want to measure a time (in ticks) between a couple of operations, with these code: long voor = DateTime.Now.TimeOfDay.Ticks; bmp1 = new Bitmap(@"\Network\im\ImageWeftIllum.bmp"); bmp2...
1
by: TC | last post by:
Anyone know what this means Parser Error Message: Error loading XML file E:\Inetpub\wwwroot\web.config Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name:...
21
by: Willie jan | last post by:
place this behind a button that fills a listbox. as you will see the time is now and then 0 or filled in???????????? by hitting the button. is there a way to determine the real elapsed time? ...
2
by: Caleb Hattingh | last post by:
Hi I tried several Google searches to no avail. I read through pretty much most of the online docs at the matplotlib sourceforge site, but didn't find what I was looking for. I went through...
1
by: raghu1 | last post by:
How to convert a given date to its equvalent ticks.: string d="5/15/2006 12:10:44 PM"; // string 2 date ... dt=Convert.ToDateTime(d); // Date 2 ticks ... dt2ticks=dt.Ticks; string ticks =...
6
by: Mark | last post by:
How many ticks are in a second? I found a link indicating that there are a million ticks per second but that didn't sound right. I'm assuming it is dependent on the speed of the processor? ...
2
by: Taras_96 | last post by:
Hi all, I've been using debug_backtrace() for a while to provide stack traces for a custom logging function. Today was the first time I've got the following error: "Notice: Undefined index:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.