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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 07 13:01:24 2020 UTC