Advertisement
Guest User

Untitled

a guest
May 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. class MySingleton {
  2. public static function numberByWhat( $number ) {
  3. return $number + 100;
  4. }
  5. public static function someCharacters( $string ) {
  6. return $string + 'abc';
  7. }
  8. }
  9.  
  10. class MyOtherSingleton {
  11. public static function getImage( $url ) {
  12. return '<img src="' . $url . MySingleton::numberByWhat( $50 ) . '">';
  13. }
  14. public static function getTextById( $id ) {
  15. if( $id == 3 ) {
  16. return 'this is my text' . MySingleton::someCharacters( 'Yeah' );
  17. }
  18. }
  19. }
  20.  
  21. function run() {
  22. echo MyOtherSingleton::getImage( 'http://www.example.com/image.png' );
  23. echo MyOtherSingleton::getTextById( 3 );
  24. }
  25.  
  26. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement