-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new examples for dynamic staatic methods, callStatic. renaming…
… files away from "example*" to something more meaningful
- Loading branch information
Showing
6 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* An example of using the __callStatic method to catch undefined | ||
* static method calls | ||
*/ | ||
|
||
class Sample | ||
{ | ||
/* no static methods defiled */ | ||
|
||
public static function __callStatic($functionName,$arguments) | ||
{ | ||
echo $functionName."\n"; | ||
var_dump($arguments); | ||
} | ||
} | ||
|
||
Sample::test(); | ||
|
||
?> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
class Sample | ||
{ | ||
public static function test() | ||
{ | ||
echo "In ".__CLASS__."\n"; | ||
} | ||
} | ||
|
||
class Sample1 | ||
{ | ||
public static function test() | ||
{ | ||
echo "In ".__CLASS__."\n"; | ||
} | ||
} | ||
|
||
$name = 'Sample'; | ||
$name::test(); | ||
|
||
$name = 'Sample1'; | ||
$name::test(); | ||
|
||
?> |
File renamed without changes.
File renamed without changes.