Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function eat_apple($apple)
- {
- return true;
- }
- function eat_apple()
- {
- $apple = func_get_arg(0);
- return true;
- }
- <?php
- function display ($a, $b, $c) {
- echo $a . " is " . $b . " " . $c;
- }
- ?>
- <?php
- display ("Rock", "good", "boy");
- - this will not throw any error.
- display ("Rock", "good");
- - this will throw fatal error.
- ?>
- class a{
- function X(MyOBJ $obj){...}
- }
- class b extends a{
- function X(string $s,int $i){...}
- }
- class c extends b{
- function X(){...}
- }
- //not good, you can only send 3 strings
- function merge_strings($s1, $s2, $s3){
- return $s1 . $s2 . $s3;
- }
- //good one
- function merge_strings(){
- return join('',func_get_args());
- }
- -function eat_apple($apple)
- +function eat_apple()
- {
- + $apple = func_get_arg(0);
- return true;
- }
Add Comment
Please, Sign In to add comment