3v4l.org

run code in 500+ PHP versions simultaneously
<?php Class Employee { public string $name; public int $age; public function __construct(string $n, int $a) { $this->name = $n; $this->age = $a; } public function getThis() { return $this; } public function getFullInfo() { return 'Меня зовут ' . $this->name . '. Мне ' . $this->age . ' года.' . PHP_EOL; } } $petr = new Employee('Петр', 23); $valera = new Employee('Валера', 54); print_r($petr->getThis()); print_r($valera->getThis()); echo $petr->getFullInfo(); echo $valera->getFullInfo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fjmuR
function name:  (null)
number of ops:  27
compiled vars:  !0 = $petr, !1 = $valera
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   NEW                                                  $2      'Employee'
          1        SEND_VAL_EX                                                  '%D0%9F%D0%B5%D1%82%D1%80'
          2        SEND_VAL_EX                                                  23
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   27     5        NEW                                                  $5      'Employee'
          6        SEND_VAL_EX                                                  '%D0%92%D0%B0%D0%BB%D0%B5%D1%80%D0%B0'
          7        SEND_VAL_EX                                                  54
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !1, $5
   29    10        INIT_FCALL                                                   'print_r'
         11        INIT_METHOD_CALL                                             !0, 'getThis'
         12        DO_FCALL                                          0  $8      
         13        SEND_VAR                                                     $8
         14        DO_ICALL                                                     
   30    15        INIT_FCALL                                                   'print_r'
         16        INIT_METHOD_CALL                                             !1, 'getThis'
         17        DO_FCALL                                          0  $10     
         18        SEND_VAR                                                     $10
         19        DO_ICALL                                                     
   32    20        INIT_METHOD_CALL                                             !0, 'getFullInfo'
         21        DO_FCALL                                          0  $12     
         22        ECHO                                                         $12
   33    23        INIT_METHOD_CALL                                             !1, 'getFullInfo'
         24        DO_FCALL                                          0  $13     
         25        ECHO                                                         $13
         26      > RETURN                                                       1

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

End of function __construct

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

End of function getthis

Function getfullinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fjmuR
function name:  getFullInfo
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                          ~0      'name'
          1        CONCAT                                               ~1      '%D0%9C%D0%B5%D0%BD%D1%8F+%D0%B7%D0%BE%D0%B2%D1%83%D1%82+', ~0
          2        CONCAT                                               ~2      ~1, '.+%D0%9C%D0%BD%D0%B5+'
          3        FETCH_OBJ_R                                          ~3      'age'
          4        CONCAT                                               ~4      ~2, ~3
          5        CONCAT                                               ~5      ~4, '+%D0%B3%D0%BE%D0%B4%D0%B0.'
          6        CONCAT                                               ~6      ~5, '%0A'
          7      > RETURN                                                       ~6
   22     8*     > RETURN                                                       null

End of function getfullinfo

End of class Employee.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.48 ms | 1746 KiB | 14 Q