Project

General

Profile

Actions

Bug #27348

closed

Incompatible call to debug_backtrace() prior to PHP 5.3.5

Added by Schmidt Timo almost 13 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2011-06-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is a bug in TYPO3 4.5.3 with old php versions. The method getOuterMostInstance() calls debug_backtrace with the parameter TRUE. This parameter was introduced with Version 5.2.5 the default value is true. The idea of this argument it to prevent the output of the object in the trace by settings the value to FALSE. Therefore it should be possible to call debug_backtrace() without any parameter which works with php version 5.2 and 5.3.

var_dump(debug_backtrace(TRUE));

?>


php --version

PHP 5.3.6 with Suhosin-Patch (cli) (built: Apr 7 2011 11:53:13)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans

Output:

array(0) {
}


php --version

PHP 5.2.4-2ubuntu5.14 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 12 2011 15:54:52)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

Output:

PHP Warning: Wrong parameter count for debug_backtrace() in /home/tschmidt/test.php on line 3

Warning: Wrong parameter count for debug_backtrace() in /home/tschmidt/test.php on line 3
NULL


Files

debug-backtrace.patch (939 Bytes) debug-backtrace.patch Schmidt Timo, 2011-06-10 12:59
issue_27348.patch (1.23 KB) issue_27348.patch Patrick Schriner, 2011-06-20 10:28

Related issues 2 (0 open2 closed)

Has duplicate TYPO3 Core - Bug #27196: debug_backtrace in getOuterMostInstanceClosed2011-06-03

Actions
Has duplicate TYPO3 Core - Bug #27584: Various warnings in log when running schedulerRejected2011-06-20

Actions
Actions #1

Updated by Schmidt Timo almost 13 years ago

short test script:

class Foo {

        public function sayHello() {

                var_dump(debug_backtrace());

        }
}

$foo = new Foo();
$foo->sayHello();
Actions #2

Updated by Xavier Perseguers almost 13 years ago

Hi,

Would you mind pushing it to Gerrit for review? I can already tell you that it does not respect CGL:

- a few assignments ($toto = ...) have the = sign aligned with tabs => single space before and after
- parentheses should be separated by a single space before

Actions #3

Updated by Oliver Hader almost 13 years ago

  • Assignee set to Oliver Hader
  • Target version set to 4.5.4
Actions #4

Updated by Patrick Schriner almost 13 years ago

Good that I looked for a ticket... This would be my patch proposal - a bit more like the original code sample. For PHP > 5.3.6 the additional if should be a performance improvement.

Actions #5

Updated by Oliver Hader almost 13 years ago

  • Subject changed from tcemain bug in php < 5.2.5 debug_backtrace to Incompatible call to debug_backtrace() prior to PHP 5.2.5
Actions #6

Updated by Oliver Hader almost 13 years ago

  • Subject changed from Incompatible call to debug_backtrace() prior to PHP 5.2.5 to Incompatible call to debug_backtrace() prior to PHP 5.3.5
Actions #7

Updated by Mr. Hudson almost 13 years ago

Patch set 1 of change Icab51963bae4e5f72c14404828cd3c9b9231796f has been pushed to the review server.
It is available at http://review.typo3.org/2836

Actions #8

Updated by Mr. Hudson almost 13 years ago

Patch set 1 of change Iaca7308c7eaadc7f47bf4927cc25924aa0640835 has been pushed to the review server.
It is available at http://review.typo3.org/2837

Actions #9

Updated by Oliver Hader almost 13 years ago

  • Status changed from New to Under Review
  • PHP Version set to 5.3
Actions #10

Updated by Oliver Hader almost 13 years ago

Thanks for the patch, however I used the simple approach to remove the additional argument.
I don't think it makes much sense to introduce switches for different PHP behaviours to specific part of the Core.
However, if it turns out to be a problem (concerning memory) we could think about a t3lib_utility_PhpCompatibility::debug_backtrace() so it can be used by other classes and methods as well...

Actions #11

Updated by Oliver Hader almost 13 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF