3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Person { private $fname; private $lname; // Constructor same class name here public function __construct($fname, $lname) { $this->fname = $fname; $this->lname = $lname; } // public method to show name public function showName() { echo "My name is: " . $this->fname . " " . $this->lname . "<br/>"; } } // creating class object $john = new Person("John", "Wick"); $john->showName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ke39i
function name:  (null)
number of ops:  8
compiled vars:  !0 = $john
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $1      'Person'
          1        SEND_VAL_EX                                                  'John'
          2        SEND_VAL_EX                                                  'Wick'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $1
   21     5        INIT_METHOD_CALL                                             !0, 'showName'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

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

End of function __construct

Function showname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ke39i
function name:  showName
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                          ~0      'fname'
          1        CONCAT                                               ~1      'My+name+is%3A+', ~0
          2        CONCAT                                               ~2      ~1, '+'
          3        FETCH_OBJ_R                                          ~3      'lname'
          4        CONCAT                                               ~4      ~2, ~3
          5        CONCAT                                               ~5      ~4, '%3Cbr%2F%3E'
          6        ECHO                                                         ~5
   16     7      > RETURN                                                       null

End of function showname

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.96 ms | 3335 KiB | 13 Q