3v4l.org

run code in 300+ PHP versions simultaneously
<?php function searchYoutube($a) { return new YoutubeSearching($a); } class YoutubeSearching { private $terms; public function __construct($terms) { $this->terms = $terms; } public function getThumbnails() { $resultData = [ 'terms' => $this->terms ]; return new SearchResult($resultData); } } class SearchResult { private $result; public function __construct(array $result) { $this->result = $result; } public function render() { echo 'Terms: ' . $this->result['terms']; } } searchYoutube('tango')->getThumbnails()->render();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4UE0D
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'searchyoutube'
          1        SEND_VAL                                                 'tango'
          2        DO_FCALL                                      0  $0      
          3        INIT_METHOD_CALL                                         $0, 'getThumbnails'
          4        DO_FCALL                                      0  $1      
          5        INIT_METHOD_CALL                                         $1, 'render'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function searchyoutube:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4UE0D
function name:  searchYoutube
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $1      'YoutubeSearching'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
    5     5*     > RETURN                                                   null

End of function searchyoutube

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

End of function __construct

Function getthumbnails:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4UE0D
function name:  getThumbnails
number of ops:  8
compiled vars:  !0 = $resultData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~1      'terms'
          1        INIT_ARRAY                                       ~2      ~1, 'terms'
          2        ASSIGN                                                   !0, ~2
   17     3        NEW                                              $4      'SearchResult'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   $4
   18     7*     > RETURN                                                   null

End of function getthumbnails

End of class YoutubeSearching.

Class SearchResult:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4UE0D
function name:  __construct
number of ops:  4
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        ASSIGN_OBJ                                               'result'
          2        OP_DATA                                                  !0
   26     3      > RETURN                                                   null

End of function __construct

Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4UE0D
function name:  render
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'result'
          1        FETCH_DIM_R                                      ~1      ~0, 'terms'
          2        CONCAT                                           ~2      'Terms%3A+', ~1
          3        ECHO                                                     ~2
   30     4      > RETURN                                                   null

End of function render

End of class SearchResult.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.82 ms | 1403 KiB | 14 Q