php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44676 instanceof operator is case insensitive
Submitted: 2008-04-09 04:23 UTC Modified: 2008-04-09 07:35 UTC
From: ctx2002 at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: Mac ox 10.5
Private report: No CVE-ID: None
 [2008-04-09 04:23 UTC] ctx2002 at gmail dot com
Description:
------------
PHP is a case sensitive language, but instanceOf is case insensitive. 
actual php version is 5.2.4, but there is not such version number in drop down list



Reproduce code:
---------------
<?php
class test
{}

$t = new test();
$r = $t instanceOf TEST;
var_dump($r);
?>

Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-09 07:35 UTC] colder@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP is not case sensitive about classes names.

class foo{} 
$a = new FOO();
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 18 14:00:02 2025 UTC