php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12256 Error tracking:pass the line number of the function call instead of fun.defin
Submitted: 2001-07-19 10:57 UTC Modified: 2003-04-22 00:01 UTC
From: sivasubraj at lycosmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 15 = ?
Subscribe to this entry?

 
 [2001-07-19 10:57 UTC] sivasubraj at lycosmail dot com
<?php

class numberHandler 
{
  function numberHandler ()
  {
  }
  
  function divide_by ($num, $div)
  {
  	// prova a rifiutare parametri incorretti
	
	
  	// this will cause an Error in case $div is zero
  	return $num/$div;
	
	
  }
};

// Some code

$n = new numberHandler();
print $n->divide_by(4,2) . "\n"; // ok
print $n->divide_by(4,0) . "\n"; // Here's the error
print numberHandler::divide_by(10,5) . "\n";


/*
A "Division by zero on line 13" error will be reported with the line number from the inner of the class and there's no way of tracking the real originator of the error.
How to make it possible to track the origin of the error, like in Java ?
Siva


Author: vincent 
Date:   2001-07-19 05:05:49

Ask the PHP boys to make their product give proper line numbers.\ 
 
The same happens when you give an incorrect number of parameters for a function. The linenumber will indicate the function definition instead of the line where you do the function call.

*/

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-22 00:01 UTC] pollita@php.net
See the manual page for: debug_backtrace()
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC