3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Server { private $hostname; private $cpu; private $ram; public function __construct($hostname = "", $cpu = "", $ram = 0) { $this->hostname = $hostname; $this->cpu = $cpu; $this->ram = $ram; } public function getHostname() { return $this->hostname; } public function setHostname($hostname) { return $this->hostname = ($hostname === null ? $this->_exception() : $hostname); } protected function _exception($text = null) { throw new InvalidArgumentException($text); } } $server = new Server; $server->setHostname(null);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMDgd
function name:  (null)
number of ops:  7
compiled vars:  !0 = $server
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $1      'Server'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   31     3        INIT_METHOD_CALL                                         !0, 'setHostname'
          4        SEND_VAL_EX                                              null
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Server:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMDgd
function name:  __construct
number of ops:  10
compiled vars:  !0 = $hostname, !1 = $cpu, !2 = $ram
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      ''
          2        RECV_INIT                                        !2      0
   10     3        ASSIGN_OBJ                                               'hostname'
          4        OP_DATA                                                  !0
   11     5        ASSIGN_OBJ                                               'cpu'
          6        OP_DATA                                                  !1
   12     7        ASSIGN_OBJ                                               'ram'
          8        OP_DATA                                                  !2
   13     9      > RETURN                                                   null

End of function __construct

Function gethostname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMDgd
function name:  getHostname
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'hostname'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function gethostname

Function sethostname:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMDgd
function name:  setHostname
number of ops:  12
compiled vars:  !0 = $hostname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~2, ->7
          3    >   INIT_METHOD_CALL                                         '_exception'
          4        DO_FCALL                                      0  $3      
          5        QM_ASSIGN                                        ~4      $3
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~4      !0
          8    >   ASSIGN_OBJ                                       ~1      'hostname'
          9        OP_DATA                                                  ~4
         10      > RETURN                                                   ~1
   23    11*     > RETURN                                                   null

End of function sethostname

Function _exception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/lMDgd
function name:  _exception
number of ops:  6
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_INIT                                        !0      null
   27     1        NEW                                              $1      'InvalidArgumentException'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   28     5*     > RETURN                                                   null

End of function _exception

End of class Server.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.32 ms | 1399 KiB | 13 Q