Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MySingleton {
- public static function numberByWhat( $number ) {
- return $number + 100;
- }
- public static function someCharacters( $string ) {
- return $string + 'abc';
- }
- }
- class MyOtherSingleton {
- public static function getImage( $url ) {
- return '<img src="' . $url . MySingleton::numberByWhat( $50 ) . '">';
- }
- public static function getTextById( $id ) {
- if( $id == 3 ) {
- return 'this is my text' . MySingleton::someCharacters( 'Yeah' );
- }
- }
- }
- function run() {
- echo MyOtherSingleton::getImage( 'http://www.example.com/image.png' );
- echo MyOtherSingleton::getTextById( 3 );
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement