View Issue Details

IDProjectCategoryView StatusLast Update
0002439XdebugUncategorizedpublic2026-10-01 11:39
ReporterInvisibleSmiley Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product Version3.5.1 
Target Version3.5dev 
Summary0002439: Overloaded set_time_limit() always returns false, even when the limit was applied
Description

Without an active debug connection, Xdebug's set_time_limit() override calls the original function, which applies
the limit and returns true. The override then unconditionally returns false.

Code that checks the return value concludes the call failed although the limit changed. For example, code that
lifts the limit and restores it afterwards only if lifting succeeded never restores it.

The unconditional RETURN_FALSE was added in 9bb1cc9 (0001834) to satisfy PHP 8's bool return type when a debug
connection is active and the original function is not called. It also overrides the original function's return value
when no connection is active.

The code is unchanged in 3.5.3 and on master (5e99179).

Steps To Reproduce
<?php                                                                                                                                                                                                                                                                          
ini_set('max_execution_time', '42');                                                                                                                                                                                                                                           

var_dump(set_time_limit(0));                                                                                                                                                                                                                                                   
var_dump(ini_get('max_execution_time'));                                                                                                                                                                                                                                       

Run with php -d xdebug.mode=debug repro.php (no debugging client, no session started).

Expected:

bool(true)                                                                                                                                                                                                                                                                     
string(1) "0"                                                                                                                                                                                                                                                                  

Actual:

bool(false)                                                                                                                                                                                                                                                                    
string(1) "0"                                                                                                                                                                                                                                                                  

With xdebug.mode=off or without Xdebug, the output is as expected.

Environment

PHP 8.3.30 (cli) (built: Jan 13 2026 22:36:55) (NTS)                                                                                                                                                                                                                           
Copyright (c) The PHP Group                                                                                                                                                                                                                                                    
Zend Engine v4.3.30, Copyright (c) Zend Technologies                                                                                                                                                                                                                           
    with Xdebug v3.5.1, Copyright (c) 2002-2026, by Derick Rethans                                                                                                                                                                                                             
    with Zend OPcache v8.3.30, Copyright (c), by Zend Technologies                                                                                                                                                                                                             

macOS 26.6.2, Homebrew formulae shivammathur/php/php@8.3 and shivammathur/extensions/xdebug@8.3.

TagsNo tags attached.
Operating System
PHP Version8.5.0-8.5.4

Activities

There are no notes attached to this issue.