3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Kubus { public function set_sisi($s); public function luas_kubus(); public function volume_kubus(); } interface Balok { public function luas_balok($p, $l); public function volume_balok($t); } class Hitung implements Kubus, Balok{ public $p,$l,$sisi; public function set_sisi($s) { $this->sisi = $s; return $this; } public function luas_kubus() { echo "Luas Kubus = " . $this->sisi * 2 . PHP_EOL; return $this; } public function volume_kubus() { echo "Volume Kubus = " . $this->sisi * 3 . PHP_EOL; return $this; } public function luas_balok($p, $l) { $this->p = $p; $this->l = $l; echo "Luas Balok = " . $p * $l . PHP_EOL; return $this; } public function volume_balok($t) { echo "Volume Balok = " . $this->p * $this->l * $t . PHP_EOL; } } $hitung = new Hitung; echo $hitung->set_sisi(4)->luas_kubus()->volume_kubus()->luas_balok(8,4)->volume_balok(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  (null)
number of ops:  20
compiled vars:  !0 = $hitung
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_CLASS                                            'hitung'
   40     1        NEW                                              $1      'Hitung'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   41     4        INIT_METHOD_CALL                                         !0, 'set_sisi'
          5        SEND_VAL_EX                                              4
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'luas_kubus'
          8        DO_FCALL                                      0  $5      
          9        INIT_METHOD_CALL                                         $5, 'volume_kubus'
         10        DO_FCALL                                      0  $6      
         11        INIT_METHOD_CALL                                         $6, 'luas_balok'
         12        SEND_VAL_EX                                              8
         13        SEND_VAL_EX                                              4
         14        DO_FCALL                                      0  $7      
         15        INIT_METHOD_CALL                                         $7, 'volume_balok'
         16        SEND_VAL_EX                                              2
         17        DO_FCALL                                      0  $8      
         18        ECHO                                                     $8
         19      > RETURN                                                   1

Class Kubus:
Function set_sisi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  set_sisi
number of ops:  2
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function set_sisi

Function luas_kubus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  luas_kubus
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function luas_kubus

Function volume_kubus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  volume_kubus
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function volume_kubus

End of class Kubus.

Class Balok:
Function luas_balok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  luas_balok
number of ops:  3
compiled vars:  !0 = $p, !1 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function luas_balok

Function volume_balok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  volume_balok
number of ops:  2
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function volume_balok

End of class Balok.

Class Hitung:
Function set_sisi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  set_sisi
number of ops:  6
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'sisi'
          2        OP_DATA                                                  !0
   18     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   19     5*     > RETURN                                                   null

End of function set_sisi

Function luas_kubus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  luas_kubus
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'sisi'
          1        MUL                                              ~1      ~0, 2
          2        CONCAT                                           ~2      'Luas+Kubus+%3D+', ~1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   22     5        FETCH_THIS                                       ~4      
          6      > RETURN                                                   ~4
   23     7*     > RETURN                                                   null

End of function luas_kubus

Function volume_kubus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  volume_kubus
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                      ~0      'sisi'
          1        MUL                                              ~1      ~0, 3
          2        CONCAT                                           ~2      'Volume+Kubus+%3D+', ~1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   27     5        FETCH_THIS                                       ~4      
          6      > RETURN                                                   ~4
   28     7*     > RETURN                                                   null

End of function volume_kubus

Function luas_balok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  luas_balok
number of ops:  13
compiled vars:  !0 = $p, !1 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   30     2        ASSIGN_OBJ                                               'p'
          3        OP_DATA                                                  !0
   31     4        ASSIGN_OBJ                                               'l'
          5        OP_DATA                                                  !1
   32     6        MUL                                              ~4      !0, !1
          7        CONCAT                                           ~5      'Luas+Balok+%3D+', ~4
          8        CONCAT                                           ~6      ~5, '%0A'
          9        ECHO                                                     ~6
   33    10        FETCH_THIS                                       ~7      
         11      > RETURN                                                   ~7
   34    12*     > RETURN                                                   null

End of function luas_balok

Function volume_balok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mRE5J
function name:  volume_balok
number of ops:  9
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        FETCH_OBJ_R                                      ~1      'p'
          2        FETCH_OBJ_R                                      ~2      'l'
          3        MUL                                              ~3      ~1, ~2
          4        MUL                                              ~4      !0, ~3
          5        CONCAT                                           ~5      'Volume+Balok+%3D+', ~4
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
   37     8      > RETURN                                                   null

End of function volume_balok

End of class Hitung.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.86 ms | 1403 KiB | 13 Q