SHARE
TWEET

Untitled

a guest Feb 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Something {
  2.     function a() {
  3.         sleep(2); echo "a()"; return TRUE;
  4.     }
  5.     function b() {
  6.         sleep(2); echo "b()"; return TRUE;
  7.     }
  8.     function c() {
  9.         sleep(2); echo "c()"; return TRUE;
  10.     }
  11. }
  12.    
  13. $something = new Something();
  14. if($something->a()) {
  15.     if($something->b()) {
  16.         if($something->c()) {
  17.             echo "everything completed!!";
  18.         }
  19.     }
  20. }
  21.    
  22. a()b()c()everything completed!!
  23.    
  24. <?php
  25. header( 'Content-Type: text/html; charset=utf-8' );
  26.  
  27. class Something {
  28.     function a() {
  29.         echo "a()" . str_repeat(' ', 1024);
  30.         ob_flush(); flush();
  31.         sleep(2); return TRUE;
  32.     }
  33.     function b() {
  34.         echo "b()" . str_repeat(' ', 1024);
  35.         ob_flush(); flush();
  36.         sleep(2); return TRUE;
  37.     }
  38.     function c() {
  39.         echo "c()" . str_repeat(' ', 1024);
  40.         ob_flush(); flush();
  41.         sleep(2); return TRUE;
  42.     }
  43. }
  44.  
  45. $something = new Something();
  46. if($something->a()) {
  47.     if($something->b()) {
  48.         if($something->c()) {
  49.             echo "everything completed!!";
  50.         }
  51.     }
  52. }
  53.    
  54. $something = new Something();
  55. if($something->a()) {
  56.     if($something->b()) {
  57.         if($something->c()) {
  58.             echo "everything completed!!";
  59.             a();
  60.         }
  61.     }
  62. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top