rfc:mixed-typehint

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:mixed-typehint [2018/06/29 13:35] – clarifications, added mixed vs. void section majklrfc:mixed-typehint [2018/07/01 16:16] – Fix void* type carusogabriel
Line 56: Line 56:
     }     }
 } }
-class Baz extends bar {+class Baz extends Bar {
     public function test(mixed $arg): mixed {     public function test(mixed $arg): mixed {
         return parent::test($arg);         return parent::test($arg);
Line 67: Line 67:
 As of PHP 7.1, PHP has a special ''void'' type. ''Void'' is not a regular type and is only valid for return types to specify that //nothing is returned//. As of PHP 7.1, PHP has a special ''void'' type. ''Void'' is not a regular type and is only valid for return types to specify that //nothing is returned//.
  
-In some other languages like C/C++ ''void'' can also be used as a //type// that accepts //any// type.+In some other languages like C/C++ ''void*'' can also be used as a //type// that accepts //any// type.
 This essentially matches the behavior of ''mixed'' in PHP. This essentially matches the behavior of ''mixed'' in PHP.
  
rfc/mixed-typehint.txt · Last modified: 2020/07/22 09:03 by kocsismate