3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ManagerSupervisorV1 { private string $name; private float $salary; public function __construct(string $name = 'Руководитель менеджеров', float $salary = 1.5) { $this->name = $name; $this->salary = $salary; } } var_dump(new ManagerSupervisorV1); class ManagerSupervisorV2 { private string $name = 'Руководитель менеджеров'; private float $salary = 1.5; public function __construct(string $name = null, float $salary = null) { $this->name = $this->name ?: $name; $this->salary = $this->salary ?: $salary; } } var_dump(new ManagerSupervisorV2); class ManagerSupervisorV3 { public function __construct( private string $name = 'Руководитель менеджеров', private float $salary = 1.5, ) {} } var_dump(new ManagerSupervisorV3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAXOb
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'ManagerSupervisorV1'
          2        DO_FCALL                                          0          
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
   25     5        INIT_FCALL                                                   'var_dump'
          6        NEW                                                  $3      'ManagerSupervisorV2'
          7        DO_FCALL                                          0          
          8        SEND_VAR                                                     $3
          9        DO_ICALL                                                     
   34    10        INIT_FCALL                                                   'var_dump'
         11        NEW                                                  $6      'ManagerSupervisorV3'
         12        DO_FCALL                                          0          
         13        SEND_VAR                                                     $6
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Class ManagerSupervisorV1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAXOb
function name:  __construct
number of ops:  7
compiled vars:  !0 = $name, !1 = $salary
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                            !0      '%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D0%B8%D1%82%D0%B5%D0%BB%D1%8C+%D0%BC%D0%B5%D0%BD%D0%B5%D0%B4%D0%B6%D0%B5%D1%80%D0%BE%D0%B2'
          1        RECV_INIT                                            !1      1.5
    8     2        ASSIGN_OBJ                                                   'name'
          3        OP_DATA                                                      !0
    9     4        ASSIGN_OBJ                                                   'salary'
          5        OP_DATA                                                      !1
   10     6      > RETURN                                                       null

End of function __construct

End of class ManagerSupervisorV1.

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

End of function __construct

End of class ManagerSupervisorV2.

Class ManagerSupervisorV3:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAXOb
function name:  __construct
number of ops:  7
compiled vars:  !0 = $name, !1 = $salary
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   RECV_INIT                                            !0      '%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D0%B8%D1%82%D0%B5%D0%BB%D1%8C+%D0%BC%D0%B5%D0%BD%D0%B5%D0%B4%D0%B6%D0%B5%D1%80%D0%BE%D0%B2'
   30     1        RECV_INIT                                            !1      1.5
   29     2        ASSIGN_OBJ                                                   'name'
          3        OP_DATA                                                      !0
   30     4        ASSIGN_OBJ                                                   'salary'
          5        OP_DATA                                                      !1
   31     6      > RETURN                                                       null

End of function __construct

End of class ManagerSupervisorV3.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.97 ms | 1670 KiB | 14 Q