3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Создаем новый класс Coor: class Coor { // данные (свойства): var $name; // методы: function Getname() { echo "<h3>John</h3>"; } } // Создаем объект класса Coor: $object = new Coor; // Получаем доступ к членам класса: $object->name = "Alex"; echo $object->name; // Выводит 'Alex' // А теперь получим доступ к методу класса (фактически, к функции внутри класса): $object->Getname(); // Выводит 'John' заглавными буквами ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYH1a
function name:  (null)
number of ops:  10
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Coor'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'Alex'
   18     5        FETCH_OBJ_R                                      ~5      !0, 'name'
          6        ECHO                                                     ~5
   21     7        INIT_METHOD_CALL                                         !0, 'Getname'
          8        DO_FCALL                                      0          
   23     9      > RETURN                                                   1

Class Coor:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYH1a
function name:  Getname
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '%3Ch3%3EJohn%3C%2Fh3%3E'
   10     1      > RETURN                                                   null

End of function getname

End of class Coor.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.02 ms | 1397 KiB | 13 Q