Doc #52684 [NEW]: document problem with class_exists function

From: Date: Tue, 24 Aug 2010 06:03:10 +0000
Subject: Doc #52684 [NEW]: document problem with class_exists function
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4915@lists.php.net to get a copy of this message
From: Operating system: window xp PHP version: 5.2.14 Package: Documentation problem Bug Type: Documentation Problem Bug description:document problem with class_exists function Description: ------------ <?php class php { private $_url = null; public function home($url) { $this->_url = $url; return $this->_url; } } if(class_exists('php')) { $php = new php(); } print_r($php->home()); ?> when class_exists('php') eq true .the code have to process $php = new php(); but I see php manual "Returns TRUE if class_name is a defined class, FALSE otherwise" if the class_name is a defined or true,and I don't new a object. Test script: --------------- <?php class php { private $_url = null; public function home($url) { $this->_url = $url; return $this->_url; } } if(class_exists('php')) { $php = new php(); } print_r($php->home()); ?> Expected result: ---------------- $php is a new object and print_r home() method -- Edit bug report at http://bugs.php.net/bug.php?id=52684&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52684&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52684&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52684&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52684&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52684&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52684&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52684&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52684&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52684&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52684&r=support Expected behavior: http://bugs.php.net/fix.php?id=52684&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52684&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52684&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52684&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52684&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52684&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52684&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52684&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52684&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52684&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52684&r=mysqlcfg

« previous php.doc.bugs (#4915) next »