demo - 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.
Result of php executing
Full code of demo.php
- <?php
- class Dog {
- var $breed;
- var $size;
- var $intelligence;
- function set_breed($new_breed){
- $this->breed= $new_breed;
- }
- function get_breed() {
- return $this->breed;
- }
- function set_size($new_size){
- $this->size= $new_size;
- }
- function get_size() {
- return $this->size;
- }
- function set_intelligence($new_intelligence){
- $this->intelligence= $new_intelligence;
- }
- function get_intelligence() {
- return $this->intelligence;
- }
- }
- $Husky = new dog();
- $Husky->set_breed("Husky");
- $Husky->set_size("Medium");
- $Husky->set_intelligence("5");
- echo $Husky->set_breed("Husky"). "</br>";
- echo $Husky->set_size("Medium"). "</br>";
- echo $Husky->set_intelligence("5") ."</br>";
File Description
- demo
- PHP Code
- 04 Feb-2021
- 693 Bytes
You can Share it:
Latest PHP Pastes