php-madness - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of php-madness.php

  1. <?php
  2.  class Base 
  3.  {
  4.     public function pop() {
  5.         echo print_r( $this, true ) . PHP_EOL;
  6.         $this->bang();
  7.     }
  8. }
  9.  
  10. class Sub extends Base {
  11.  
  12.     public function bang() {
  13.         echo print_r( $this, true ) . PHP_EOL;
  14.         echo "This shouldn't work!";
  15.     }
  16. }
  17.  
  18. $obj = new Sub();
  19. $obj->pop();
File Description
  • php-madness
  • PHP Code
  • 15 Dec-2018
  • 307 Bytes
You can Share it: