3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractLocation implements HeaderInterface { /** * URI for this header * * @var UriInterface */ protected $uri = null; /** * Create location-based header from string * * @param string $headerLine * @return AbstractLocation * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) { $locationHeader = new static(); // ZF-5520 - IIS bug, no space after colon list($name, $uri) = GenericHeader::splitHeaderLine($headerLine); // check to ensure proper header type for this factory if (strtolower($name) !== strtolower($locationHeader->getFieldName())) { throw new Exception\InvalidArgumentException( 'Invalid header line for "' . $locationHeader->getFieldName() . '" header string' ); } HeaderValue::assertValid($uri); $locationHeader->setUri(trim($uri)); return $locationHeader; } /** * Set the URI/URL for this header, this can be a string or an instance of Zend\Uri\Http * * @param string|UriInterface $uri * @return AbstractLocation * @throws Exception\InvalidArgumentException */ public function setUri($uri) { if (is_string($uri)) { try { $uri = UriFactory::factory($uri); } catch (UriException\InvalidUriPartException $e) { throw new Exception\InvalidArgumentException( sprintf('Invalid URI passed as string (%s)', (string) $uri), $e->getCode(), $e ); } } elseif (!($uri instanceof UriInterface)) { throw new Exception\InvalidArgumentException('URI must be an instance of Zend\Uri\Http or a string'); } $this->uri = $uri; return $this; } /** * Return the URI for this header * * @return string */ public function getUri() { if ($this->uri instanceof UriInterface) { return $this->uri->toString(); } return $this->uri; } /** * Return the URI for this header as an instance of Zend\Uri\Http * * @return UriInterface */ public function uri() { if ($this->uri === null || is_string($this->uri)) { $this->uri = UriFactory::factory($this->uri); } return $this->uri; } /** * Get header value as URI string * * @return string */ public function getFieldValue() { return $this->getUri(); } /** * Output header line * * @return string */ public function toString() { return $this->getFieldName() . ': ' . $this->getUri(); } /** * Allow casting to string * * @return string */ public function __toString() { return $this->toString(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'abstractlocation'
  121     1      > RETURN                                                   1

Class AbstractLocation:
Function fromstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  fromString
number of ops:  41
compiled vars:  !0 = $headerLine, !1 = $locationHeader, !2 = $name, !3 = $uri
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        NEW                          static              $4      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   24     4        INIT_STATIC_METHOD_CALL                                  'GenericHeader', 'splitHeaderLine'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $7      
          7        FETCH_LIST_R                                     $8      $7, 0
          8        ASSIGN                                                   !2, $8
          9        FETCH_LIST_R                                     $10     $7, 1
         10        ASSIGN                                                   !3, $10
         11        FREE                                                     $7
   27    12        INIT_FCALL                                               'strtolower'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $12     
         15        INIT_FCALL                                               'strtolower'
         16        INIT_METHOD_CALL                                         !1, 'getFieldName'
         17        DO_FCALL                                      0  $13     
         18        SEND_VAR                                                 $13
         19        DO_ICALL                                         $14     
         20        IS_NOT_IDENTICAL                                         $12, $14
         21      > JMPZ                                                     ~15, ->30
   28    22    >   NEW                                              $16     'Exception%5CInvalidArgumentException'
   29    23        INIT_METHOD_CALL                                         !1, 'getFieldName'
         24        DO_FCALL                                      0  $17     
         25        CONCAT                                           ~18     'Invalid+header+line+for+%22', $17
         26        CONCAT                                           ~19     ~18, '%22+header+string'
         27        SEND_VAL_EX                                              ~19
         28        DO_FCALL                                      0          
         29      > THROW                                         0          $16
   33    30    >   INIT_STATIC_METHOD_CALL                                  'HeaderValue', 'assertValid'
         31        SEND_VAR_EX                                              !3
         32        DO_FCALL                                      0          
   34    33        INIT_METHOD_CALL                                         !1, 'setUri'
         34        INIT_FCALL                                               'trim'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $22     
         37        SEND_VAR_NO_REF_EX                                       $22
         38        DO_FCALL                                      0          
   36    39      > RETURN                                                   !1
   37    40*     > RETURN                                                   null

End of function fromstring

Function seturi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 30
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/1auQT
function name:  setUri
number of ops:  35
compiled vars:  !0 = $uri, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   RECV                                             !0      
   48     1        TYPE_CHECK                                   64          !0
          2      > JMPZ                                                     ~2, ->23
   50     3    >   INIT_STATIC_METHOD_CALL                                  'UriFactory', 'factory'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !0, $3
          7      > JMP                                                      ->22
   51     8  E > > CATCH                                       last         'UriException%5CInvalidUriPartException'
   52     9    >   NEW                                              $5      'Exception%5CInvalidArgumentException'
   53    10        INIT_FCALL                                               'sprintf'
         11        SEND_VAL                                                 'Invalid+URI+passed+as+string+%28%25s%29'
         12        CAST                                          6  ~6      !0
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        SEND_VAR_NO_REF_EX                                       $7
   54    16        INIT_METHOD_CALL                                         !1, 'getCode'
         17        DO_FCALL                                      0  $8      
         18        SEND_VAR_NO_REF_EX                                       $8
   53    19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
         21      > THROW                                         0          $5
         22    > > JMP                                                      ->30
   58    23    >   INSTANCEOF                                       ~10     !0, 'UriInterface'
         24        BOOL_NOT                                         ~11     ~10
         25      > JMPZ                                                     ~11, ->30
   59    26    >   NEW                                              $12     'Exception%5CInvalidArgumentException'
         27        SEND_VAL_EX                                              'URI+must+be+an+instance+of+Zend%5CUri%5CHttp+or+a+string'
         28        DO_FCALL                                      0          
         29      > THROW                                         0          $12
   61    30    >   ASSIGN_OBJ                                               'uri'
         31        OP_DATA                                                  !0
   63    32        FETCH_THIS                                       ~15     
         33      > RETURN                                                   ~15
   64    34*     > RETURN                                                   null

End of function seturi

Function geturi:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  getUri
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E >   FETCH_OBJ_R                                      ~0      'uri'
          1        INSTANCEOF                                               ~0, 'UriInterface'
          2      > JMPZ                                                     ~1, ->7
   74     3    >   FETCH_OBJ_R                                      ~2      'uri'
          4        INIT_METHOD_CALL                                         ~2, 'toString'
          5        DO_FCALL                                      0  $3      
          6      > RETURN                                                   $3
   76     7    >   FETCH_OBJ_R                                      ~4      'uri'
          8      > RETURN                                                   ~4
   77     9*     > RETURN                                                   null

End of function geturi

Function uri:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/1auQT
function name:  uri
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   86     0  E >   FETCH_OBJ_R                                      ~0      'uri'
          1        TYPE_CHECK                                    2  ~1      ~0
          2      > JMPNZ_EX                                         ~1      ~1, ->6
          3    >   FETCH_OBJ_R                                      ~2      'uri'
          4        TYPE_CHECK                                   64  ~3      ~2
          5        BOOL                                             ~1      ~3
          6    > > JMPZ                                                     ~1, ->14
   87     7    >   INIT_STATIC_METHOD_CALL                                  'UriFactory', 'factory'
          8        CHECK_FUNC_ARG                                           
          9        FETCH_OBJ_FUNC_ARG                               $5      'uri'
         10        SEND_FUNC_ARG                                            $5
         11        DO_FCALL                                      0  $6      
         12        ASSIGN_OBJ                                               'uri'
         13        OP_DATA                                                  $6
   89    14    >   FETCH_OBJ_R                                      ~7      'uri'
         15      > RETURN                                                   ~7
   90    16*     > RETURN                                                   null

End of function uri

Function getfieldvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  getFieldValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   INIT_METHOD_CALL                                         'getUri'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
  100     3*     > RETURN                                                   null

End of function getfieldvalue

Function tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  toString
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E >   INIT_METHOD_CALL                                         'getFieldName'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%3A+'
          3        INIT_METHOD_CALL                                         'getUri'
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      ~1, $2
          6      > RETURN                                                   ~3
  110     7*     > RETURN                                                   null

End of function tostring

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1auQT
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  119     0  E >   INIT_METHOD_CALL                                         'toString'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
  120     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class AbstractLocation.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.25 ms | 1408 KiB | 19 Q