osCommerce / oscommerce2

osCommerce Online Merchant v2.x
http://www.oscommerce.com
MIT License
281 stars 222 forks source link

each depracated in php 7.2 #597

Open oitsuki opened 6 years ago

oitsuki commented 6 years ago

I think it could interesting to change this function in osc each is deprecated in 7.2 php release files dbStatement.php list(, $this->result) = each($this->cache_data);

specials.php while (list($key, $value) = each($define_list)) {

oitsuki commented 6 years ago

specials.php while (list($key, $value) = each($define_list)) { by foreach($define_list as $key => $value) {

list(, $this->result) = each($this->cache_data); by $this->result = current($this->cache_data);

oitsuki commented 6 years ago

for shopping_cart and navigation history

    function unserialize($broken) {
      for(reset($broken);$kv=each($broken);) {
        $key=$kv['key'];
        if (gettype($this->$key)!="user function")
        $this->$key=$kv['value'];
      }
    }

by

    function unserialize($broken) {
      foreach ($broken as $k => $v) {
        $kv = [$k, $v];
        $key=$kv['key'];
        if (gettype($this->$key)!="user function")
          $this->$key=$kv['value'];
      }
    }