rfc:token_as_object

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:token_as_object [2020/02/15 15:46] nikicrfc:token_as_object [2020/02/25 15:58] nikic
Line 120: Line 120:
  
     /** Get the name of the token. */     /** Get the name of the token. */
-    public function getTokenName(): string {+    public function getTokenName(): ?string {
         if ($this->id < 256) {         if ($this->id < 256) {
             return chr($this->id);             return chr($this->id);
 +        } elseif ('UNKNOWN' !== $name = token_name($this->id)) {
 +            return $name;
         } else {         } else {
-            return token_name($this->id);+            return null;
         }         }
     }     }
rfc/token_as_object.txt · Last modified: 2020/11/12 13:33 by nikic