ChildType - 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 ChildType.php

  1. <?php
  2.  
  3. class Foo {}
  4.  
  5. class Bar extends Foo {}
  6.  
  7. class FooBar {
  8.     public function test(Foo $foo) {
  9.         var_dump($foo);
  10.     }
  11. }
  12.  
  13. $fooBar = new FooBar();
  14. $fooBar->test(new Bar());
File Description
  • ChildType
  • PHP Code
  • 23 Jan-2020
  • 181 Bytes
You can Share it: