php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79093 david@grudl.com
Submitted: 2020-01-10 11:00 UTC Modified: 2020-01-10 11:03 UTC
From: david at grudl dot com Assigned:
Status: Duplicate Package: Output Control
PHP Version: 7.4.1 OS:
Private report: No CVE-ID: None
 [2020-01-10 11:00 UTC] david at grudl dot com
Description:
------------
In PHP 7.4 class_exists($c, true) can return false and class_exists($c, false) can return true in one moment.



Test script:
---------------
file classes.php:
-----

<?php

class C1
{
	function f($arg)
	{
	}
}

class C2 extends C1
{
	function f()
	{
	}
}
?>


file test.php:
-------

<?php

set_error_handler(function () {
	var_dump(class_exists('C2', true)); // returns false
	var_dump(class_exists('C2', false)); // returns true
});

include 'classes.php';

?>

Expected result:
----------------
Both return the same value.

Actual result:
--------------
var_dump(class_exists('C2', true)); // returns false
var_dump(class_exists('C2', false)); // returns true

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-10 11:03 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2020-01-10 11:03 UTC] nikic@php.net
Duplicate of bug #79022, which is fixed in 7.4.2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC