|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-01-19 10:17 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 09 12:00:01 2025 UTC |
I mean: return !file_exists("classes/{$object->class}.php"); in the test script...