3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Movie { private $one = ''; private $two = ''; private $three = ''; public function one(): self { $this->one = "One "; return $this; // return object } public function two(): self { $this->two = "Flew Over the "; return $this; // return object } public function three(): self { $this->three = "Cuckoo's Nest"; return $this; // return object } public function show(): string { return $this->one . $this->two . $this->three; } } $movie = new Movie(); echo $movie->one()->two()->three()->show();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUjde
function name:  (null)
number of ops:  13
compiled vars:  !0 = $movie
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   NEW                                                  $1      'Movie'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   34     3        INIT_METHOD_CALL                                             !0, 'one'
          4        DO_FCALL                                          0  $4      
          5        INIT_METHOD_CALL                                             $4, 'two'
          6        DO_FCALL                                          0  $5      
          7        INIT_METHOD_CALL                                             $5, 'three'
          8        DO_FCALL                                          0  $6      
          9        INIT_METHOD_CALL                                             $6, 'show'
         10        DO_FCALL                                          0  $7      
         11        ECHO                                                         $7
         12      > RETURN                                                       1

Class Movie:
Function one:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUjde
function name:  one
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN_OBJ                                                   'one'
          1        OP_DATA                                                      'One+'
   11     2        FETCH_THIS                                           ~1      
          3        VERIFY_RETURN_TYPE                                           ~1
          4      > RETURN                                                       ~1
   12     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function one

Function two:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUjde
function name:  two
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   ASSIGN_OBJ                                                   'two'
          1        OP_DATA                                                      'Flew+Over+the+'
   17     2        FETCH_THIS                                           ~1      
          3        VERIFY_RETURN_TYPE                                           ~1
          4      > RETURN                                                       ~1
   18     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function two

Function three:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUjde
function name:  three
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   ASSIGN_OBJ                                                   'three'
          1        OP_DATA                                                      'Cuckoo%27s+Nest'
   23     2        FETCH_THIS                                           ~1      
          3        VERIFY_RETURN_TYPE                                           ~1
          4      > RETURN                                                       ~1
   24     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function three

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XUjde
function name:  show
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                          ~0      'one'
          1        FETCH_OBJ_R                                          ~1      'two'
          2        CONCAT                                               ~2      ~0, ~1
          3        FETCH_OBJ_R                                          ~3      'three'
          4        CONCAT                                               ~4      ~2, ~3
          5        VERIFY_RETURN_TYPE                                           ~4
          6      > RETURN                                                       ~4
   29     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null

End of function show

End of class Movie.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
186.3 ms | 1973 KiB | 13 Q