php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42352 instanceof get_class() generate parse error
Submitted: 2007-08-20 17:10 UTC Modified: 2007-08-20 17:37 UTC
From: jausions@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.3 OS: Irrelevant
Private report: No CVE-ID: None
 [2007-08-20 17:10 UTC] jausions@php.net
Description:
------------
insteanceof and get_class() don't play nice. The following line of code produces a parsing error.

Reproduce code:
---------------
<?php

if ($a instanceof get_class($b)) {
   echo 'Yeah!';
}

?>

Expected result:
----------------
Parsing fine

Actual result:
--------------
Parse error: parse error, unexpected '('

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-20 17:37 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 23:00:01 2026 UTC