3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parcel { protected $weight; protected $destinationCountry; public function setWeight($weight) { echo "the weight is" . $weight; $this->weight = $weight; return $this; } public function setCountry($destinationCountry) { echo "country is " . $destinationCountry; $this->destinationCountry = $destinationCountry; return $this; } } $myParcel = new Parcel(); $myParcel->setWeight(5)->setCountry("India");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NIIHQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $myParcel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Parcel'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'setWeight'
          4        SEND_VAL_EX                                              5
          5        DO_FCALL                                      0  $4      
          6        INIT_METHOD_CALL                                         $4, 'setCountry'
          7        SEND_VAL_EX                                              'India'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Parcel:
Function setweight:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NIIHQ
function name:  setWeight
number of ops:  8
compiled vars:  !0 = $weight
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        CONCAT                                           ~1      'the+weight+is', !0
          2        ECHO                                                     ~1
    9     3        ASSIGN_OBJ                                               'weight'
          4        OP_DATA                                                  !0
   10     5        FETCH_THIS                                       ~3      
          6      > RETURN                                                   ~3
   11     7*     > RETURN                                                   null

End of function setweight

Function setcountry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NIIHQ
function name:  setCountry
number of ops:  8
compiled vars:  !0 = $destinationCountry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        CONCAT                                           ~1      'country+is+', !0
          2        ECHO                                                     ~1
   15     3        ASSIGN_OBJ                                               'destinationCountry'
          4        OP_DATA                                                  !0
   16     5        FETCH_THIS                                       ~3      
          6      > RETURN                                                   ~3
   17     7*     > RETURN                                                   null

End of function setcountry

End of class Parcel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.52 ms | 1399 KiB | 13 Q