Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Star *

* is a character, used in various situations:

  • Multiplication: 3 * 2 == 6
  • Power: 3 ** 2 == 3 * 3 == 9
  • With slash, /* is a multi line comment: /* */
  • With double star and a slash, /** is a phpdoc comment: /** */.
  • As a wildcard in glob() calls
  • As a wildcard in fnmatch() calls
  • As a wildcard for all columns in SQL queries: SELECT * FROM table
  • As a quantifier in regex: 0 or more, for example /a*/
  • As part of a multiline comment with /** */ and /* */.
<?php

    file_get_contents('/tmp/test.txt');
    
    echo 2 * 3; // 6 
    echo 2 ** 3; // * 
    
    /*
     A multiline comment
    */

?>

Documentation

See Also