3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { // Attributes private $firstName; private $lastName; // Constructor public function __construct($firstName, $lastName) { $this->firstName = $firstName; $this->lastName = $lastName; } // Method public function getFullName() { return $this->firstName.' '.$this->lastName; } } // Creating an instance of User $user = new User('Loïc', 'Chardonnet'); // Print 'Loïc Chardonnet' echo $user->getFullName(); echo $user->firstName;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SLKf1
function name:  (null)
number of ops:  11
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'User'
          1        SEND_VAL_EX                                              'Lo%C3%AFc'
          2        SEND_VAL_EX                                              'Chardonnet'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   27     5        INIT_METHOD_CALL                                         !0, 'getFullName'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
   29     8        FETCH_OBJ_R                                      ~5      !0, 'firstName'
          9        ECHO                                                     ~5
         10      > RETURN                                                   1

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

End of function __construct

Function getfullname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SLKf1
function name:  getFullName
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'firstName'
          1        CONCAT                                           ~1      ~0, '+'
          2        FETCH_OBJ_R                                      ~2      'lastName'
          3        CONCAT                                           ~3      ~1, ~2
          4      > RETURN                                                   ~3
   20     5*     > RETURN                                                   null

End of function getfullname

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.89 ms | 1395 KiB | 13 Q