3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Weather { /** * service properties */ public $attributes; /** * constant definitions (forecast mode) */ const MARINE = "marine"; const MOUNTAIN = "ski"; const WEATHER = "weather"; /** * constructor for this class * @param string $key the API key for this element * @return mixed an instance of this class * @example $weather = new \Services\Information\Weather(); * @example $weather = new \Services\Information\Weather("sample key"); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function __construct($key = "ad14d73de30ee62b02aa6022a1b2d") { $this->attributes["key"] = $key; $this->attributes["mode"] = self::WEATHER; return $this; } /** * returns the date (in ISO format) for this element * @return string the date (in ISO format) for this element * @example $date = $weather->getDate(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getDate() { if (!empty($this->attributes["date"])) { return $this->attributes["date"]; } } /** * returns the number of forecasting days for this element * @return numeric the number of forecasting days for this element * @example $days = $weather->getDays(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getDays() { if (!empty($this->attributes["days"])) { return $this->attributes["days"]; } } /** * returns the API key for this element * @return string the API key for this element * @example $key = $weather->getKey(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getKey() { if (!empty($this->attributes["key"])) { return $this->attributes["key"]; } } /** * returns the location for this element * @return mixed the location for this element * @example $location = $weather->getLocation(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getLocation() { if (!empty($this->attributes["location"])) { return $this->attributes["location"]; } } /** * returns the forecasting mode for this element * @return mixed the forecasting mode for this element * @example $mode = $weather->getMode(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getMode() { if (!empty($this->attributes["mode"])) { return $this->attributes["mode"]; } } /** * returns the list of parameters for this element * @return string the list of URL request parameters for this element * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function getParameters() { if (!empty($this->attributes)) { $parameters[] = "format=json"; if (!empty($this->attributes["location"])) { $parameters[] = "q=" . urlencode($this->attributes["location"]); } if (!empty($this->attributes["days"])) { $parameters[] = "num_of_days=" . $this->attributes["days"]; } if (!empty($this->attributes["date"])) { $parameters[] = "date=" . $this->attributes["date"]; } if (!empty($this->attributes["key"])) { $parameters[] = "key=" . $this->attributes["key"]; } return "?" . implode("&", $parameters); } } /** * sets the number of forecasting days for this element * @param numeric $days the number of forecasting days for this element * @example $weather->setDays(3); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function setDays($days) { if (!empty($days)) { if (is_numeric($days)) { if ($days > 0) { $this->attributes["days"] = $days; } } } return $this; } /** * sets the API key for this element * @param string $key the API key for this element * @example $weather->setKey("sample key"); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function setKey($key) { if (!empty($key)) { $this->attributes["key"] = $key; } return $this; } /** * sets the location for this element * @param mixed $data the input data for this element (either the latitude/longitude pair or the city name) * @example $weather->setLocation(39.607679, 2.869080); * @example $weather->setLocation("palma"); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function setLocation() { if (!empty($arguments = func_get_args())) { if (!empty($count = func_num_args())) { if ($count > 1) { if (!empty($latitude = current($arguments))) { if (!empty($longitude = next($arguments))) { if (is_numeric($latitude)) { if (is_numeric($longitude)) { $this->attributes["location"] = [$latitude, $longitude]; } } } } } elseif ($count > 0) { if (!empty($location = current($arguments))) { if (!is_numeric($location)) { $this->attributes["location"] = $location; } } } } } return $this; } /** * sets the forecast mode for this element * @param string $mode the forecast mode for this element * @example $weather->setMode(\Services\Information\Weather::MARINE); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function setMode($mode) { if (!empty($mode)) { if (in_array($mode, [ self::MARINE, self::MOUNTAIN, self::WEATHER ], true)) { $this->attributes["mode"] = $mode; } } return $this; } /** * outputs this element * @return mixed the weather forecasting data for this element * @example $data = $weather->output(); * @version 1.0 * @author Julio Meca Hansen <jmecahansen@gmail.com> */ public function output() { $output = false; if (!empty($this->attributes["mode"])) { if (in_array($this->attributes["mode"], [ self::MARINE, self::MOUNTAIN, self::WEATHER ], true)) { if (!empty($this->attributes["key"])) { if (!empty($this->attributes["location"])) { if (!empty($this->attributes["days"])) { if (!empty($c = curl_init(\Helpers\URL::getProtocol() . "://api.worldweatheronline.com/free/v2/{$this->attributes["mode"]}.ashx{$this->getParameters()}"))) { curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); if (!empty($input = json_decode(curl_exec($c), true))) { if (!empty($input["data"])) { $codes = [ 113 => _("soleado"), 116 => _("parcialmente nublado"), 119 => _("nublado"), 122 => _("nublado"), 143 => _("bruma"), 176 => _("lluvia irregular"), 179 => _("nieve irregular"), 182 => _("aguanieve irregular"), 185 => _("congelación irregular"), 200 => _("nublado con posibilidad de tormenta"), 227 => _("nevada con viento ligero"), 230 => _("tormenta de nieve"), 248 => _("niebla"), 260 => _("niebla helada"), 263 => _("nublado con llovizna"), 266 => _("llovizna"), 281 => _("llovizna con helada"), 284 => _("llovizna fuerte con helada"), 293 => _("nublado con lluvia ligera"), 296 => _("lluvia ligera"), 299 => _("lluvia moderada esporádica"), 302 => _("lluvia moderada"), 305 => _("lluvia fuerte esporádica"), 308 => _("lluvia fuerte"), 311 => _("lluvia ligera con helada"), 314 => _("lluvia moderada o fuerte con helada"), 317 => _("aguanieve ligera"), 320 => _("aguanieve moderada o fuerte"), 323 => _("nublado con nevada ligera"), 326 => _("nevada ligera"), 329 => _("nublado con nevada moderada"), 332 => _("nevada moderada"), 335 => _("nublado con nevada fuerte"), 338 => _("nevada fuerte"), 350 => _("granizo"), 353 => _("episodios de lluvia ligera"), 356 => _("episodios de lluvia moderada o fuerte"), 359 => _("lluvia torrencial"), 362 => _("episodios de aguanieve ligera"), 365 => _("episodios de aguanieve moderada o fuerte"), 368 => _("episodios de nieve ligera"), 371 => _("episodios de nieve moderada o fuerte"), 374 => _("episodios de granizo ligera"), 377 => _("episodios de granizo moderada o fuerte"), 386 => _("nublado con lluvia ligera y truenos"), 389 => _("nevada moderada o fuerte con tormenta"), 392 => _("nublado con nevada ligera y truenos"), 395 => _("nevada moderada o fuerte con tormenta") ]; if ($this->attributes["mode"] === self::MARINE) { print_r($input["data"]); } elseif ($this->attributes["mode"] === self::MOUNTAIN) { print_r($input["data"]); } elseif ($this->attributes["mode"] === self::WEATHER) { if (!empty($input["data"]["weather"])) { foreach ($input["data"]["weather"] as $forecast) { $output["forecast"][] = [ "date" => $forecast["date"], "temperature" => [ "minimum" => [ "C" => $forecast["mintempC"], "F" => $forecast["mintempF"], ], "maximum" => [ "C" => $forecast["maxtempC"], "F" => $forecast["maxtempF"], ] ], "details" => array_map(function ($i) use ($codes) { return [ "cloudcover" => $i["cloudcover"], "description" => [ "code" => $i["weatherCode"], "text" => $codes[$i["weatherCode"]] ], "humidity" => $i["humidity"], "precipitation" => $i["precipMM"], "pressure" => $i["pressure"], "temperature" => [ "felt" => [ "C" => $i["FeelsLikeC"], "F" => $i["FeelsLikeF"], ], "measured" => [ "C" => $i["tempC"], "F" => $i["tempF"], ] ], "time" => str_pad($i["time"] / 100, 2, "0", STR_PAD_LEFT) . ":00", "visibility" => $i["visibility"], "wind" => [ "angle" => $i["winddirDegree"], "direction" => $i["winddir16Point"], "speed" => [ "kilometers" => $i["windspeedKmph"], "miles" => $i["windspeedMiles"] ] ] ]; }, $forecast["hourly"]) ]; } } } } } } } } } } } return $output; } } $w = new Weather(); $w->setLocation("Palma"); $w->setDays(3); $w->setMode(Weather::MARINE); print_r($w->output()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  (null)
number of ops:  18
compiled vars:  !0 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  360     0  E >   NEW                                              $1      'Weather'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
  361     3        INIT_METHOD_CALL                                         !0, 'setLocation'
          4        SEND_VAL_EX                                              'Palma'
          5        DO_FCALL                                      0          
  362     6        INIT_METHOD_CALL                                         !0, 'setDays'
          7        SEND_VAL_EX                                              3
          8        DO_FCALL                                      0          
  363     9        INIT_METHOD_CALL                                         !0, 'setMode'
         10        SEND_VAL_EX                                              'marine'
         11        DO_FCALL                                      0          
  365    12        INIT_FCALL                                               'print_r'
         13        INIT_METHOD_CALL                                         !0, 'output'
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
  366    17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7i86N%3A310%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  {closure}
number of ops:  51
compiled vars:  !0 = $i, !1 = $codes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  310     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
  312     2        FETCH_DIM_R                                      ~2      !0, 'cloudcover'
          3        INIT_ARRAY                                       ~3      ~2, 'cloudcover'
  314     4        FETCH_DIM_R                                      ~4      !0, 'weatherCode'
          5        INIT_ARRAY                                       ~5      ~4, 'code'
  315     6        FETCH_DIM_R                                      ~6      !0, 'weatherCode'
          7        FETCH_DIM_R                                      ~7      !1, ~6
          8        ADD_ARRAY_ELEMENT                                ~5      ~7, 'text'
          9        ADD_ARRAY_ELEMENT                                ~3      ~5, 'description'
  317    10        FETCH_DIM_R                                      ~8      !0, 'humidity'
         11        ADD_ARRAY_ELEMENT                                ~3      ~8, 'humidity'
  318    12        FETCH_DIM_R                                      ~9      !0, 'precipMM'
         13        ADD_ARRAY_ELEMENT                                ~3      ~9, 'precipitation'
  319    14        FETCH_DIM_R                                      ~10     !0, 'pressure'
         15        ADD_ARRAY_ELEMENT                                ~3      ~10, 'pressure'
  322    16        FETCH_DIM_R                                      ~11     !0, 'FeelsLikeC'
         17        INIT_ARRAY                                       ~12     ~11, 'C'
  323    18        FETCH_DIM_R                                      ~13     !0, 'FeelsLikeF'
         19        ADD_ARRAY_ELEMENT                                ~12     ~13, 'F'
         20        INIT_ARRAY                                       ~14     ~12, 'felt'
  326    21        FETCH_DIM_R                                      ~15     !0, 'tempC'
         22        INIT_ARRAY                                       ~16     ~15, 'C'
  327    23        FETCH_DIM_R                                      ~17     !0, 'tempF'
         24        ADD_ARRAY_ELEMENT                                ~16     ~17, 'F'
         25        ADD_ARRAY_ELEMENT                                ~14     ~16, 'measured'
         26        ADD_ARRAY_ELEMENT                                ~3      ~14, 'temperature'
  330    27        INIT_FCALL                                               'str_pad'
         28        FETCH_DIM_R                                      ~18     !0, 'time'
         29        DIV                                              ~19     ~18, 100
         30        SEND_VAL                                                 ~19
         31        SEND_VAL                                                 2
         32        SEND_VAL                                                 '0'
         33        SEND_VAL                                                 0
         34        DO_ICALL                                         $20     
         35        CONCAT                                           ~21     $20, '%3A00'
         36        ADD_ARRAY_ELEMENT                                ~3      ~21, 'time'
  331    37        FETCH_DIM_R                                      ~22     !0, 'visibility'
         38        ADD_ARRAY_ELEMENT                                ~3      ~22, 'visibility'
  333    39        FETCH_DIM_R                                      ~23     !0, 'winddirDegree'
         40        INIT_ARRAY                                       ~24     ~23, 'angle'
  334    41        FETCH_DIM_R                                      ~25     !0, 'winddir16Point'
         42        ADD_ARRAY_ELEMENT                                ~24     ~25, 'direction'
  336    43        FETCH_DIM_R                                      ~26     !0, 'windspeedKmph'
         44        INIT_ARRAY                                       ~27     ~26, 'kilometers'
  337    45        FETCH_DIM_R                                      ~28     !0, 'windspeedMiles'
         46        ADD_ARRAY_ELEMENT                                ~27     ~28, 'miles'
         47        ADD_ARRAY_ELEMENT                                ~24     ~27, 'speed'
         48        ADD_ARRAY_ELEMENT                                ~3      ~24, 'wind'
         49      > RETURN                                                   ~3
  341    50*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7i86N%3A310%240

Class Weather:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  __construct
number of ops:  10
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_INIT                                        !0      'ad14d73de30ee62b02aa6022a1b2d'
   25     1        FETCH_OBJ_W                                      $1      'attributes'
          2        ASSIGN_DIM                                               $1, 'key'
          3        OP_DATA                                                  !0
   26     4        FETCH_OBJ_W                                      $3      'attributes'
          5        ASSIGN_DIM                                               $3, 'mode'
          6        OP_DATA                                                  'weather'
   27     7        FETCH_THIS                                       ~5      
          8      > RETURN                                                   ~5
   28     9*     > RETURN                                                   null

End of function __construct

Function getdate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getDate
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   FETCH_OBJ_IS                                     ~0      'attributes'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~1      ~0, 'date'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   39     4    >   FETCH_OBJ_R                                      ~3      'attributes'
          5        FETCH_DIM_R                                      ~4      ~3, 'date'
          6      > RETURN                                                   ~4
   41     7    > > RETURN                                                   null

End of function getdate

Function getdays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getDays
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   FETCH_OBJ_IS                                     ~0      'attributes'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~1      ~0, 'days'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   52     4    >   FETCH_OBJ_R                                      ~3      'attributes'
          5        FETCH_DIM_R                                      ~4      ~3, 'days'
          6      > RETURN                                                   ~4
   54     7    > > RETURN                                                   null

End of function getdays

Function getkey:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getKey
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   FETCH_OBJ_IS                                     ~0      'attributes'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~1      ~0, 'key'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   65     4    >   FETCH_OBJ_R                                      ~3      'attributes'
          5        FETCH_DIM_R                                      ~4      ~3, 'key'
          6      > RETURN                                                   ~4
   67     7    > > RETURN                                                   null

End of function getkey

Function getlocation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getLocation
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   77     0  E >   FETCH_OBJ_IS                                     ~0      'attributes'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~1      ~0, 'location'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   78     4    >   FETCH_OBJ_R                                      ~3      'attributes'
          5        FETCH_DIM_R                                      ~4      ~3, 'location'
          6      > RETURN                                                   ~4
   80     7    > > RETURN                                                   null

End of function getlocation

Function getmode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getMode
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   90     0  E >   FETCH_OBJ_IS                                     ~0      'attributes'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~1      ~0, 'mode'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   91     4    >   FETCH_OBJ_R                                      ~3      'attributes'
          5        FETCH_DIM_R                                      ~4      ~3, 'mode'
          6      > RETURN                                                   ~4
   93     7    > > RETURN                                                   null

End of function getmode

Function getparameters:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 50
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 35
Branch analysis from position: 26
Branch analysis from position: 17
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7i86N
function name:  getParameters
number of ops:  51
compiled vars:  !0 = $parameters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   ISSET_ISEMPTY_PROP_OBJ                           ~1      'attributes'
          1        BOOL_NOT                                         ~2      ~1
          2      > JMPZ                                                     ~2, ->50
  103     3    >   ASSIGN_DIM                                               !0
          4        OP_DATA                                                  'format%3Djson'
  105     5        FETCH_OBJ_IS                                     ~4      'attributes'
          6        ISSET_ISEMPTY_DIM_OBJ                         1  ~5      ~4, 'location'
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->17
  106     9    >   INIT_FCALL                                               'urlencode'
         10        FETCH_OBJ_R                                      ~8      'attributes'
         11        FETCH_DIM_R                                      ~9      ~8, 'location'
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                         $10     
         14        CONCAT                                           ~11     'q%3D', $10
         15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  ~11
  109    17    >   FETCH_OBJ_IS                                     ~12     'attributes'
         18        ISSET_ISEMPTY_DIM_OBJ                         1  ~13     ~12, 'days'
         19        BOOL_NOT                                         ~14     ~13
         20      > JMPZ                                                     ~14, ->26
  110    21    >   FETCH_OBJ_R                                      ~16     'attributes'
         22        FETCH_DIM_R                                      ~17     ~16, 'days'
         23        CONCAT                                           ~18     'num_of_days%3D', ~17
         24        ASSIGN_DIM                                               !0
         25        OP_DATA                                                  ~18
  113    26    >   FETCH_OBJ_IS                                     ~19     'attributes'
         27        ISSET_ISEMPTY_DIM_OBJ                         1  ~20     ~19, 'date'
         28        BOOL_NOT                                         ~21     ~20
         29      > JMPZ                                                     ~21, ->35
  114    30    >   FETCH_OBJ_R                                      ~23     'attributes'
         31        FETCH_DIM_R                                      ~24     ~23, 'date'
         32        CONCAT                                           ~25     'date%3D', ~24
         33        ASSIGN_DIM                                               !0
         34        OP_DATA                                                  ~25
  117    35    >   FETCH_OBJ_IS                                     ~26     'attributes'
         36        ISSET_ISEMPTY_DIM_OBJ                         1  ~27     ~26, 'key'
         37        BOOL_NOT                                         ~28     ~27
         38      > JMPZ                                                     ~28, ->44
  118    39    >   FETCH_OBJ_R                                      ~30     'attributes'
         40        FETCH_DIM_R                                      ~31     ~30, 'key'
         41        CONCAT                                           ~32     'key%3D', ~31
         42        ASSIGN_DIM                                               !0
         43        OP_DATA                                                  ~32
  121    44    >   INIT_FCALL                                               'implode'
         45        SEND_VAL                                                 '%26'
         46        SEND_VAR                                                 !0
         47        DO_ICALL                                         $33     
         48        CONCAT                                           ~34     '%3F', $33
         49      > RETURN                                                   ~34
  123    50    > > RETURN                                                   null

End of function getparameters

Function setdays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 13
Branch analysis from position: 13
filename:       /in/7i86N
function name:  setDays
number of ops:  16
compiled vars:  !0 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  132     0  E >   RECV                                             !0      
  133     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->13
  134     4    >   INIT_FCALL                                               'is_numeric'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->13
  135     8    >   IS_SMALLER                                               0, !0
          9      > JMPZ                                                     ~4, ->13
  136    10    >   FETCH_OBJ_W                                      $5      'attributes'
         11        ASSIGN_DIM                                               $5, 'days'
         12        OP_DATA                                                  !0
  141    13    >   FETCH_THIS                                       ~7      
         14      > RETURN                                                   ~7
  142    15*     > RETURN                                                   null

End of function setdays

Function setkey:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/7i86N
function name:  setKey
number of ops:  10
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  151     0  E >   RECV                                             !0      
  152     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
  153     4    >   FETCH_OBJ_W                                      $3      'attributes'
          5        ASSIGN_DIM                                               $3, 'key'
          6        OP_DATA                                                  !0
  156     7    >   FETCH_THIS                                       ~5      
          8      > RETURN                                                   ~5
  157     9*     > RETURN                                                   null

End of function setkey

Function setlocation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 57
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 57
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 40
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 39
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 39
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 57
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 57
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 57
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 57
Branch analysis from position: 57
Branch analysis from position: 57
Branch analysis from position: 57
filename:       /in/7i86N
function name:  setLocation
number of ops:  60
compiled vars:  !0 = $arguments, !1 = $count, !2 = $latitude, !3 = $longitude, !4 = $location
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  168     0  E >   FUNC_GET_ARGS                                    ~5      
          1        ASSIGN                                           ~6      !0, ~5
          2        BOOL_NOT                                         ~7      ~6
          3        BOOL_NOT                                         ~8      ~7
          4      > JMPZ                                                     ~8, ->57
  169     5    >   FUNC_NUM_ARGS                                    ~9      
          6        ASSIGN                                           ~10     !1, ~9
          7        BOOL_NOT                                         ~11     ~10
          8        BOOL_NOT                                         ~12     ~11
          9      > JMPZ                                                     ~12, ->57
  170    10    >   IS_SMALLER                                               1, !1
         11      > JMPZ                                                     ~13, ->40
  171    12    >   INIT_FCALL                                               'current'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $14     
         15        ASSIGN                                           ~15     !2, $14
         16        BOOL_NOT                                         ~16     ~15
         17        BOOL_NOT                                         ~17     ~16
         18      > JMPZ                                                     ~17, ->39
  172    19    >   INIT_FCALL                                               'next'
         20        SEND_REF                                                 !0
         21        DO_ICALL                                         $18     
         22        ASSIGN                                           ~19     !3, $18
         23        BOOL_NOT                                         ~20     ~19
         24        BOOL_NOT                                         ~21     ~20
         25      > JMPZ                                                     ~21, ->39
  173    26    >   INIT_FCALL                                               'is_numeric'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                         $22     
         29      > JMPZ                                                     $22, ->39
  174    30    >   INIT_FCALL                                               'is_numeric'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                         $23     
         33      > JMPZ                                                     $23, ->39
  175    34    >   INIT_ARRAY                                       ~26     !2
         35        ADD_ARRAY_ELEMENT                                ~26     !3
         36        FETCH_OBJ_W                                      $24     'attributes'
         37        ASSIGN_DIM                                               $24, 'location'
         38        OP_DATA                                                  ~26
         39    > > JMP                                                      ->57
  180    40    >   IS_SMALLER                                               0, !1
         41      > JMPZ                                                     ~27, ->57
  181    42    >   INIT_FCALL                                               'current'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $28     
         45        ASSIGN                                           ~29     !4, $28
         46        BOOL_NOT                                         ~30     ~29
         47        BOOL_NOT                                         ~31     ~30
         48      > JMPZ                                                     ~31, ->57
  182    49    >   INIT_FCALL                                               'is_numeric'
         50        SEND_VAR                                                 !4
         51        DO_ICALL                                         $32     
         52        BOOL_NOT                                         ~33     $32
         53      > JMPZ                                                     ~33, ->57
  183    54    >   FETCH_OBJ_W                                      $34     'attributes'
         55        ASSIGN_DIM                                               $34, 'location'
         56        OP_DATA                                                  !4
  190    57    >   FETCH_THIS                                       ~36     
         58      > RETURN                                                   ~36
  191    59*     > RETURN                                                   null

End of function setlocation

Function setmode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 9
filename:       /in/7i86N
function name:  setMode
number of ops:  12
compiled vars:  !0 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  200     0  E >   RECV                                             !0      
  201     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->9
  202     4    >   IN_ARRAY                                                 !0, <array>
          5      > JMPZ                                                     ~3, ->9
  207     6    >   FETCH_OBJ_W                                      $4      'attributes'
          7        ASSIGN_DIM                                               $4, 'mode'
          8        OP_DATA                                                  !0
  211     9    >   FETCH_THIS                                       ~6      
         10      > RETURN                                                   ~6
  212    11*     > RETURN                                                   null

End of function setmode

Function output:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 314
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 314
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 314
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 314
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 314
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 314
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 314
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 314
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 262, Position 2 = 267
Branch analysis from position: 262
1 jumps found. (Code = 42) Position 1 = 314
Branch analysis from position: 314
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 267
2 jumps found. (Code = 43) Position 1 = 271, Position 2 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.55 ms | 1428 KiB | 27 Q