3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Author { private $name; private $id; public function __construct($id, $name = '') { $this->id = $id; $this->name = $name; } public function name() { return $this->name; } public function setName($name) { $this->name = $name; } public function id() { return $this->id; } } class Post { private $id; private $title; private $body; private $author; public function __construct($id, $title, $body, $author) { $this->id = $id; $this->title = $title; $this->body = $body; $this->author = $author; } public function id() { return $this->id; } public function title() { return $this->title; } public function setTitle($title) { $this->title = $title; } public function author() { return $this->author; } public function setAuthor(Author $author) { $this->author = $author; } } $post = new Post(111, 'A Song of Ice and Fire', 'My book is the shiz', new Author(222, 'George RR Martin')); echo $post->author->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VEhSa
function name:  (null)
number of ops:  15
compiled vars:  !0 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   NEW                                              $1      'Post'
          1        SEND_VAL_EX                                              111
          2        SEND_VAL_EX                                              'A+Song+of+Ice+and+Fire'
          3        SEND_VAL_EX                                              'My+book+is+the+shiz'
          4        NEW                                              $2      'Author'
          5        SEND_VAL_EX                                              222
          6        SEND_VAL_EX                                              'George+RR+Martin'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $2
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $1
   73    11        FETCH_OBJ_R                                      ~6      !0, 'author'
         12        FETCH_OBJ_R                                      ~7      ~6, 'name'
         13        ECHO                                                     ~7
         14      > RETURN                                                   1

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

End of function __construct

Function name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VEhSa
function name:  name
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      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function name

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

End of function setname

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

End of function id

End of class Author.

Class Post:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VEhSa
function name:  __construct
number of ops:  13
compiled vars:  !0 = $id, !1 = $title, !2 = $body, !3 = $author
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   40     4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  !0
   41     6        ASSIGN_OBJ                                               'title'
          7        OP_DATA                                                  !1
   42     8        ASSIGN_OBJ                                               'body'
          9        OP_DATA                                                  !2
   43    10        ASSIGN_OBJ                                               'author'
         11        OP_DATA                                                  !3
   44    12      > RETURN                                                   null

End of function __construct

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

End of function id

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

End of function title

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

End of function settitle

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

End of function author

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

End of function setauthor

End of class Post.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.57 ms | 1403 KiB | 13 Q