|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-27 20:52 UTC] the_djmaze at hotmail dot com
Description:
------------
Trying to add a method named "isset" to a class.
I know it's a language construct but shouldn't the parser check if isset() is called as a function?
Reproduce code:
---------------
<?php
abstract class anObject
{
public static function isset($key) { return $key; }
}
?>
Expected result:
----------------
It works
Actual result:
--------------
Parse error: syntax error, unexpected T_ISSET, expecting T_STRING
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 21:00:01 2025 UTC |
There is no documentation on a method called isset() in objects afaik. The following code shows this: Reproduce code: --------------- class FooBar { } $t = new FooBar(); $t->isset(); Expected result --------------- Nothing Actual result ------------- Fatal error: Call to undefined method FooBar::isset() get_class_methods('FooBar') also shows the non-existence of these methods. In addition adding a method 'unset' to an object throws the same error.