3v4l.org

run code in 300+ PHP versions simultaneously
<?php class persegi { private $p; private $l; private $luas; /*public function __construct($p,$l)//construktor tanpa parameter default { $this->p=$p;$this->l=$l; }*/ public function __construct($p,$l=5) { $this->p=$p;$this->l=$l; } public function hasil() { $this->luas=$this->p*$this->l; return "Nilai Luas = ".$this->luas; } } //$obj=new persegi(); //pembuatan object tanpa parameter->muncul error $obj=new persegi(10); //pembuatan object berjalan sukses $obj2=new persegi(7); $obj2->__construct(9,5); echo $obj->hasil();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TckJB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $obj, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'persegi'
          1        SEND_VAL_EX                                              10
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   26     4        NEW                                              $5      'persegi'
          5        SEND_VAL_EX                                              7
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   27     8        INIT_METHOD_CALL                                         !1, '__construct'
          9        SEND_VAL_EX                                              9
         10        SEND_VAL_EX                                              5
         11        DO_FCALL                                      0          
   28    12        INIT_METHOD_CALL                                         !0, 'hasil'
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Class persegi:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TckJB
function name:  __construct
number of ops:  7
compiled vars:  !0 = $p, !1 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      5
   15     2        ASSIGN_OBJ                                               'p'
          3        OP_DATA                                                  !0
          4        ASSIGN_OBJ                                               'l'
          5        OP_DATA                                                  !1
   16     6      > RETURN                                                   null

End of function __construct

Function hasil:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TckJB
function name:  hasil
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~1      'p'
          1        FETCH_OBJ_R                                      ~2      'l'
          2        MUL                                              ~3      ~1, ~2
          3        ASSIGN_OBJ                                               'luas'
          4        OP_DATA                                                  ~3
   20     5        FETCH_OBJ_R                                      ~4      'luas'
          6        CONCAT                                           ~5      'Nilai+Luas+%3D+', ~4
          7      > RETURN                                                   ~5
   21     8*     > RETURN                                                   null

End of function hasil

End of class persegi.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.32 ms | 1003 KiB | 13 Q