Posted by Anonymous Wed 21st Mar 2007 15:45 - Syntax is PHP - 28 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
  1. srand();
  2.  
  3. class A{}
  4. class B extends A { function coo() { echo 'bar'; } }
  5. class C /*extends A*/ { function coo() { echo 'car'; } }
  6.  
  7. function produce() { if (rand(0, 1) == 0) return new B; return new C; }
  8.  
  9. $q = produce();
  10. $q->coo();
  11.  

PermaLink to this entry https://pastebin.co.uk/12118
Posted by Anonymous Wed 21st Mar 2007 15:45 - Syntax is PHP - 28 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0