Edit report at https://bugs.php.net/bug.php?id=64030&edit=1
ID: 64030 User updated by: bobwei9 at hotmail dot com Reported by: bobwei9 at hotmail dot com Summary: Extend the ::class-feature Status: Open Type: Feature/Change Request Package: Scripting Engine problem Operating System: Irrelevant PHP Version: 5.5Git-2013-01-19 (Git) Block user comment: N Private report: N New Comment: I mean: return !file_exists("classes/{$object->class}.php"); in the test script... Previous Comments: ------------------------------------------------------------------------ [2013-01-19 10:17:57] bobwei9 at hotmail dot com Description: ------------ I just have seen this commit: http://git.php.net/?p=php-src.git;a=commitdiff;h=8991ed016fa257c9f8ba42580c34568b3c2ce3e5 Could you also add $instance->class ? Which operates on an already instanced Object. Would be for example useful to be able to handle internal and userland classes differently. Test script: --------------- function isInternalObject ($object) { if (!is_object($object)) return false; return !file_exists("classes/$object.php"); } // In the case where you name the files with the name of their class... include 'classes/Foo.php'; $foo = new Foo(); $std = new stdClass; var_dump(isInternalObject($foo)); var_dump(isInternalObject($std)); Expected result: ---------------- bool(false) bool(true) Actual result: -------------- Notice: Undefined property: %s::$class in php shell code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64030&edit=1