3v4l.org

run code in 300+ PHP versions simultaneously
<?php use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; class Solution { public function __construct(private ClientInterface $client) { } public function getHost(): string { return $this->client->getConfig('base_uri'); } } $solution = new Solution(new Client(['base_uri' => 'https://internal-api.checkout51.com/'])); var_dump($solution->getHost());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BgWJ8
function name:  (null)
number of ops:  13
compiled vars:  !0 = $solution
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Solution'
          1        NEW                                              $2      'GuzzleHttp%5CClient'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   18     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'getHost'
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function __construct

Function gethost:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BgWJ8
function name:  getHost
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'client'
          1        INIT_METHOD_CALL                                         ~0, 'getConfig'
          2        SEND_VAL_EX                                              'base_uri'
          3        DO_FCALL                                      0  $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   14     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function gethost

End of class Solution.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.41 ms | 1427 KiB | 14 Q