Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php method type hinting

<?php	// use type hinting to specify the expected data type of an argument
function startParty(array $guests, array $food = null) {
    // party stuff...
}
$guests = array("Susan Foreman", "Sarah Jane Smith");
startParty($guests, null);
?>
Source by mlocati.github.io #
 
PREVIOUS NEXT
Tagged: #php #method #type #hinting
ADD COMMENT
Topic
Name
9+9 =