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

  1. <?php 
  2. class ev_Orders {
  3.     public $moja_zmienna;
  4.     public function save(){
  5.         $this->moja_zmienna = 'wartosc_1';
  6.         (new MojaFunkcjonalnosc($this))->run();
  7.         echo $this->moja_zmienna;
  8.     }
  9. }
  10.  
  11. class MojaFunkcjonalnosc{
  12.     public $bean;
  13.     public function __construct($bean){
  14.         $this->bean = $bean;
  15.     }
  16.     public function run(){
  17.         $this->bean->moja_zmienna = 'wartosc_2';
  18.     }
  19. }
  20.  
  21. (new ev_Orders)->save();
File Description
  • ev_Orders
  • PHP Code
  • 14 Oct-2021
  • 441 Bytes
You can Share it: