3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public $name; public function setName($name) { $this->name = $name; } } class Student extends Person { public function showName() { echo $this->name; } } $person = new Person(); $person->setName("Daan"); $student = new Student(); $student->setName('Daan'); $student->showName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lBvJp
function name:  (null)
number of ops:  15
compiled vars:  !0 = $person, !1 = $student
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Person'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        INIT_METHOD_CALL                                         !0, 'setName'
          4        SEND_VAL_EX                                              'Daan'
          5        DO_FCALL                                      0          
   24     6        NEW                                              $6      'Student'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   25     9        INIT_METHOD_CALL                                         !1, 'setName'
         10        SEND_VAL_EX                                              'Daan'
         11        DO_FCALL                                      0          
   26    12        INIT_METHOD_CALL                                         !1, 'showName'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function setname

End of class Person.

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

End of function showname

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

End of function setname

End of class Student.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1395 KiB | 13 Q