3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NewEraProxy { private $proxy_full_url; private $proxy_protocol; private $proxy_ssl; private $proxy_name; private $proxy_port; /** Constructor */ public function __construct($proxy_full_url) { $this->update_object($proxy_full_url); } /** Object updater */ public function update_object($proxy_full_url) { $this->proxy_full_url = $proxy_full_url; $this->proxy_ssl = ((strpos($this->proxy_full_url, 'ssl') === 0) ? true : false); $this->proxy_protocol = ($this->proxy_ssl ? 'ssl' : 'tcp'); // Grab other parameters if(false !== ($tmp = strpos($proxy_full_url, '://'))) $proxy_full_url = substr($proxy_full_url, $tmp + 3); $proxy_full_url = explode(':', $proxy_full_url); // Host, Port, Path $this->proxy_name = $proxy_full_url[0]; $this->proxy_port = (int)(isset($proxy_full_url[1]) ? $proxy_full_url[1] : ($this->proxy_ssl ? '443' : '80')); } /** Getter for the private properties */ public function __get($var) { $var = 'proxy_'.$var; if(isset($this->{$var})) return $this->{$var}; } } $newEraProxy = new NewEraProxy('tcp://127.0.0.1:8080'); var_dump($newEraProxy); var_dump($newEraProxy->full_url); var_dump($newEraProxy->protocol); var_dump($newEraProxy->ssl); var_dump($newEraProxy->name); var_dump($newEraProxy->port); var_dump($newEraProxy->non_existent_property);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c0Av3
function name:  (null)
number of ops:  32
compiled vars:  !0 = $newEraProxy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   NEW                                              $1      'NewEraProxy'
          1        SEND_VAL_EX                                              'tcp%3A%2F%2F127.0.0.1%3A8080'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   42     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   43     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~5      !0, 'full_url'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   44    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~7      !0, 'protocol'
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
   45    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~9      !0, 'ssl'
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                                 
   46    19        INIT_FCALL                                               'var_dump'
         20        FETCH_OBJ_R                                      ~11     !0, 'name'
         21        SEND_VAL                                                 ~11
         22        DO_ICALL                                                 
   47    23        INIT_FCALL                                               'var_dump'
         24        FETCH_OBJ_R                                      ~13     !0, 'port'
         25        SEND_VAL                                                 ~13
         26        DO_ICALL                                                 
   49    27        INIT_FCALL                                               'var_dump'
         28        FETCH_OBJ_R                                      ~15     !0, 'non_existent_property'
         29        SEND_VAL                                                 ~15
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class NewEraProxy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c0Av3
function name:  __construct
number of ops:  5
compiled vars:  !0 = $proxy_full_url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         'update_object'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   13     4      > RETURN                                                   null

End of function __construct

Function update_object:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 48
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
Branch analysis from position: 35
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
Branch analysis from position: 19
filename:       /in/c0Av3
function name:  update_object
number of ops:  58
compiled vars:  !0 = $proxy_full_url, !1 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'proxy_full_url'
          2        OP_DATA                                                  !0
   18     3        INIT_FCALL                                               'strpos'
          4        FETCH_OBJ_R                                      ~4      'proxy_full_url'
          5        SEND_VAL                                                 ~4
          6        SEND_VAL                                                 'ssl'
          7        DO_ICALL                                         $5      
          8        IS_IDENTICAL                                             $5, 0
          9      > JMPZ                                                     ~6, ->12
         10    >   QM_ASSIGN                                        ~7      <true>
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~7      <false>
         13    >   ASSIGN_OBJ                                               'proxy_ssl'
         14        OP_DATA                                                  ~7
   19    15        FETCH_OBJ_R                                      ~9      'proxy_ssl'
         16      > JMPZ                                                     ~9, ->19
         17    >   QM_ASSIGN                                        ~10     'ssl'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~10     'tcp'
         20    >   ASSIGN_OBJ                                               'proxy_protocol'
         21        OP_DATA                                                  ~10
   22    22        INIT_FCALL                                               'strpos'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 '%3A%2F%2F'
         25        DO_ICALL                                         $11     
         26        ASSIGN                                           ~12     !1, $11
         27        TYPE_CHECK                                  1018          ~12
         28      > JMPZ                                                     ~13, ->35
   23    29    >   INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !0
         31        ADD                                              ~14     !1, 3
         32        SEND_VAL                                                 ~14
         33        DO_ICALL                                         $15     
         34        ASSIGN                                                   !0, $15
   25    35    >   INIT_FCALL                                               'explode'
         36        SEND_VAL                                                 '%3A'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $17     
         39        ASSIGN                                                   !0, $17
   28    40        FETCH_DIM_R                                      ~20     !0, 0
         41        ASSIGN_OBJ                                               'proxy_name'
         42        OP_DATA                                                  ~20
   29    43        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 1
         44      > JMPZ                                                     ~22, ->48
         45    >   FETCH_DIM_R                                      ~23     !0, 1
         46        QM_ASSIGN                                        ~24     ~23
         47      > JMP                                                      ->54
         48    >   FETCH_OBJ_R                                      ~25     'proxy_ssl'
         49      > JMPZ                                                     ~25, ->52
         50    >   QM_ASSIGN                                        ~26     '443'
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~26     '80'
         53    >   QM_ASSIGN                                        ~24     ~26
         54    >   CAST                                          4  ~27     ~24
         55        ASSIGN_OBJ                                               'proxy_port'
         56        OP_DATA                                                  ~27
   30    57      > RETURN                                                   null

End of function update_object

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c0Av3
function name:  __get
number of ops:  8
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   34     1        CONCAT                                           ~1      'proxy_', !0
          2        ASSIGN                                                   !0, ~1
   35     3        ISSET_ISEMPTY_PROP_OBJ                                   !0
          4      > JMPZ                                                     ~3, ->7
   36     5    >   FETCH_OBJ_R                                      ~4      !0
          6      > RETURN                                                   ~4
   37     7    > > RETURN                                                   null

End of function __get

End of class NewEraProxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.99 ms | 1409 KiB | 21 Q