php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45633 class_exists return nothing and die script
Submitted: 2008-07-26 20:48 UTC Modified: 2008-07-26 21:09 UTC
From: alexmontoanelli at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alexmontoanelli at gmail dot com
New email:
PHP Version: OS:

 

 [2008-07-26 20:48 UTC] alexmontoanelli at gmail dot com
Description:
------------
I Have a Interface class, One normal class,
if the normal class do not have all interfaces methods implements,
an i call class_exists('my_normal_class_extends_interface'),
the script is die, and no value is retorned.
If the normal class have all methods defined, then work fine.
Sorry for bad english.

Reproduce code:
---------------
Interface myInterface {
public funtion foo();
}
class normalClass implements myInterface{}
var_dump(class_exists('normalClass'));




Expected result:
----------------
i exptec php Reporting a fatal error, because the first 'normalClass',
no implements all methods in interface myInterface

Actual result:
--------------
Php die, when call class_exists

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-26 21:09 UTC] lstrojny@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

First, there is a typo in your example (\"funtion\" instead of \"function\"). Without the typo the example fails in the parsing stage and class_exists() is never executed. Please check that the ini settings display_errors is on.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 20 00:00:02 2025 UTC