June 2017
Intermediate to advanced
536 pages
9h 49m
English
There are two ways to pass arguments within the code:
by value is the default PHP behavior, as shown in the following example:
<?phpclass Util{ function hello($msg) { $msg = "<p>Welcome $msg</p>"; return $msg; }}$str = 'John';$obj = new Util();echo $obj->hello($str); // Welcome Johnecho $str; // John
Looking at the internals of the hello() method, we can see it is resetting the $msg argument value to another string value wrapped ...
Read now
Unlock full access