3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Author { private $name; private $id; public function __construct($id) { $this->id = $id; $this->name = null; } public function name() { return $this->name; } public function setName($name) { $this->name = $name; } public function id() { return $this->id; } public function __get($name) { echo 'we dont have all the pieces, look em up'; die; } } 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)); var_dump($post->author()->name());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mbpvj
function name:  (null)
number of ops:  18
compiled vars:  !0 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   77     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        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $2
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $1
   78    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'author'
         12        DO_FCALL                                      0  $6      
         13        INIT_METHOD_CALL                                         $6, 'name'
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/Mbpvj
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        ECHO                                                     'we+dont+have+all+the+pieces%2C+look+em+up'
          2      > EXIT                                                     
   32     3*     > RETURN                                                   null

End of function __get

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/Mbpvj
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
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   45     4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  !0
   46     6        ASSIGN_OBJ                                               'title'
          7        OP_DATA                                                  !1
   47     8        ASSIGN_OBJ                                               'body'
          9        OP_DATA                                                  !2
   48    10        ASSIGN_OBJ                                               'author'
         11        OP_DATA                                                  !3
   49    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/Mbpvj
function name:  id
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
   54     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/Mbpvj
function name:  title
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   FETCH_OBJ_R                                      ~0      'title'
          1      > RETURN                                                   ~0
   59     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/Mbpvj
function name:  setTitle
number of ops:  4
compiled vars:  !0 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
   63     1        ASSIGN_OBJ                                               'title'
          2        OP_DATA                                                  !0
   64     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/Mbpvj
function name:  author
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   FETCH_OBJ_R                                      ~0      'author'
          1      > RETURN                                                   ~0
   69     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/Mbpvj
function name:  setAuthor
number of ops:  4
compiled vars:  !0 = $author
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
   73     1        ASSIGN_OBJ                                               'author'
          2        OP_DATA                                                  !0
   74     3      > RETURN                                                   null

End of function setauthor

End of class Post.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.66 ms | 1396 KiB | 15 Q