3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Users_model extends CI_Model { protected $table_name = 'users'; // Добавляет пользователя в базу данных protected function signup_user($data = FALSE) { if (!is_array($data) || !$data) return FALSE; $this->db->insert($this->table_name, $data); return $this->db->insert_id(); } protected function delete($id = FALSE) { if (!$id) return FALSE; $this->db->delete($this->table_name, array('id' => $id)); return $this->db->affected_rows() ? TRUE : FALSE; } public function get_user_info($fields = '*', $user_id = FALSE, $where = FALSE) { if (!$user_id) return FALSE; if (!is_array($where)) $where = array('id' => (int)$user_id); $query = $this->db->select($fields)->get_where($this->table_name, $where); if ($query->num_rows()) { return $query->row(); } return FALSE; } protected function get_users($fields = '*', $where = FALSE, $from = FALSE, $limit = FALSE) { $this->db->select($fields); if (is_array($where)) $this->db->where($where); if ($from !== FALSE and $limit !== FALSE) $this->db->limit($from, $limit); $query = $this->db->get($this->table_name); if ($query->num_rows()) { return $query->result(); } return FALSE; } protected function get_current_user($fields = '*') { $user_id = $this->session->userdata('id'); $query = $this->db->select($fields)->get_where($this->table_name, array('id' => $user_id)); if ($query->num_rows()) { return $query->row(); } return FALSE; } protected function get_user_by_email($fields = '*', $email = FALSE) { if (!$email) return FALSE; $query = $this->db->select($fields)->get_where($this->table_name, array('login' => $email)); if ($query->num_rows()) { return $query->row(); } return FALSE; } protected function update_user_info($user_id = FALSE, $data = FALSE) { if (!$user_id or !$data) return FALSE; if (!$this->is_user_exist($user_id)) return FALSE; $this->db->where('id', $user_id)->update($this->table_name, $data); return $this->db->affected_rows() ? TRUE : FALSE; } protected function is_user_exist($user_id = FALSE) { if (!$user_id) return FALSE; $query = $this->db->select('id')->get_where($this->table_name, array('id' => $user_id)); return $query->num_rows() ? TRUE : FALSE; } public function is_email_exist($email = FALSE) { if (!$email) return FALSE; $query = $this->db->select('id')->get_where($this->table_name, array('login' => $email)); return $query->num_rows() ? TRUE : FALSE; } public function is_logged_in() { return (bool)$this->session->userdata('id'); } public function get_user_group() { return (int)$this->session->userdata('group'); } // Генерит случайные пароли protected function password_verify($password = '', $hash = '') { $this->load->helper('password'); return password_verify($password, $hash); } // Хеширует пароль пользователя protected function password_hash($password = FALSE) { $this->load->helper('password'); $this->load->helper('string'); $hash = password_hash($password, PASSWORD_DEFAULT, array("cost" => 10, "salt" => random_string('alnum', 25))); return $hash; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0050.01018.40
8.3.50.0080.01222.05
8.3.40.0120.00918.75
8.3.30.0040.01420.29
8.3.20.0030.00618.61
8.3.10.0040.00420.96
8.3.00.0120.00619.38
8.2.180.0100.01016.50
8.2.170.0040.01122.96
8.2.160.0090.00620.30
8.2.150.0070.00724.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00019.77
8.2.110.0100.00021.04
8.2.100.0070.00417.91
8.2.90.0060.00319.08
8.2.80.0050.00317.97
8.2.70.0060.00617.63
8.2.60.0000.00817.93
8.2.50.0000.00918.07
8.2.40.0030.00519.95
8.2.30.0040.00421.23
8.2.20.0040.00417.72
8.2.10.0000.00817.84
8.2.00.0050.00317.80
8.1.280.0070.01125.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0080.00322.66
8.1.230.0060.00621.03
8.1.220.0030.00618.77
8.1.210.0000.00819.04
8.1.200.0080.00417.36
8.1.190.0000.00817.66
8.1.180.0080.00018.10
8.1.170.0090.00018.68
8.1.160.0000.00718.94
8.1.150.0000.00718.58
8.1.140.0000.00717.50
8.1.130.0050.00217.80
8.1.120.0080.00317.42
8.1.110.0000.00917.39
8.1.100.0030.00517.53
8.1.90.0000.00717.50
8.1.80.0000.00817.45
8.1.70.0030.00517.51
8.1.60.0040.00417.59
8.1.50.0000.00717.37
8.1.40.0030.00517.43
8.1.30.0000.00817.64
8.1.20.0030.00517.70
8.1.10.0040.00417.41
8.1.00.0040.00417.45
8.0.300.0000.00719.95
8.0.290.0040.00417.29
8.0.280.0030.00318.37
8.0.270.0000.00717.27
8.0.260.0070.00016.88
8.0.250.0000.00817.02
8.0.240.0000.00916.98
8.0.230.0040.00416.96
8.0.220.0070.00016.84
8.0.210.0000.00816.87
8.0.200.0030.00316.89
8.0.190.0000.00817.05
8.0.180.0040.00417.00
8.0.170.0050.00316.98
8.0.160.0000.00716.99
8.0.150.0050.00316.80
8.0.140.0040.00416.83
8.0.130.0060.00013.36
8.0.120.0030.00516.95
8.0.110.0040.00416.85
8.0.100.0030.00517.00
8.0.90.0000.00716.93
8.0.80.0150.00716.87
8.0.70.0040.00416.98
8.0.60.0040.00416.78
8.0.50.0000.00816.79
8.0.30.0090.01017.21
8.0.20.0060.01717.40
8.0.10.0000.00717.12
8.0.00.0090.00816.83
7.4.330.0020.00216.69
7.4.320.0000.00716.63
7.4.300.0040.00416.64
7.4.290.0070.00016.41
7.4.280.0050.00316.65
7.4.270.0070.00016.62
7.4.260.0060.00013.35
7.4.250.0080.00016.50
7.4.240.0000.00816.46
7.4.230.0030.00316.59
7.4.220.0100.00916.53
7.4.210.0080.00816.39
7.4.200.0000.00716.57
7.4.190.0040.00416.71
7.4.160.0060.00916.60
7.4.150.0140.00317.40
7.4.140.0190.01417.86
7.4.130.0090.00916.48
7.4.120.0150.00516.59
7.4.110.0090.00916.37
7.4.100.0090.00916.31
7.4.90.0130.01416.52
7.4.80.0070.01019.39
7.4.70.0090.00916.51
7.4.60.0140.00316.55
7.4.50.0000.00916.56
7.4.40.0120.00322.77
7.4.30.0090.01216.48
7.3.330.0000.00513.24
7.3.320.0000.00613.36
7.3.310.0040.00416.32
7.3.300.0070.00016.32
7.3.290.0040.01116.29
7.3.280.0090.00816.33
7.3.270.0120.00617.40
7.3.260.0080.01518.24
7.3.250.0110.00616.36
7.3.240.0030.01316.56
7.3.230.0130.00316.39
7.3.210.0140.00316.53
7.3.200.0090.00919.39
7.3.190.0090.01216.18
7.3.180.0090.00616.28
7.3.170.0080.01516.39
7.3.160.0100.00716.61
7.3.10.0050.00816.50
7.3.00.0070.00616.55
7.2.330.0070.01016.52
7.2.320.0110.01216.43
7.2.310.0130.01016.70
7.2.300.0060.01516.38
7.2.290.0060.00916.50
7.2.130.0070.00916.67
7.2.120.0060.00716.67
7.2.110.0090.00716.70
7.2.100.0070.00616.80
7.2.90.0050.01016.66
7.2.80.0090.00416.82
7.2.70.0090.00616.63
7.2.60.0060.00716.72
7.2.50.0070.00816.78
7.2.40.0060.00416.67
7.2.30.0050.00716.67
7.2.20.0060.00716.75
7.2.10.0070.00616.68
7.2.00.0050.01017.29
7.1.250.0080.00515.53
7.1.200.0410.00315.54
7.1.100.0000.01217.83
7.1.70.0040.00416.91
7.1.60.0000.02419.24
7.1.50.0100.01316.79
7.1.00.0030.07022.45
7.0.200.0080.00016.56
7.0.140.0030.07322.08
7.0.100.0300.06720.02
7.0.90.0100.05020.20
7.0.80.0070.04319.96
7.0.70.0000.04320.00
7.0.60.0030.04019.98
7.0.50.0030.03720.40
7.0.40.0100.03320.15
7.0.30.0030.05720.15
7.0.20.0070.04020.04
7.0.10.0030.05320.11
7.0.00.0170.04019.99
5.6.280.0000.07721.02
5.6.250.0100.08020.61
5.6.240.0070.05320.72
5.6.230.0070.04020.75
5.6.220.0100.03320.59
5.6.210.0000.04320.60
5.6.200.0170.03021.12
5.6.190.0070.08021.12
5.6.180.0070.04721.17
5.6.170.0100.03721.06
5.6.160.0100.03721.12
5.6.150.0100.05721.13
5.6.140.0000.05321.11
5.6.130.0000.04720.99
5.6.120.0070.04021.14
5.6.110.0070.04721.07
5.6.100.0100.03721.19
5.6.90.0100.03720.96
5.6.80.0070.03720.42
5.6.70.0000.04020.41
5.6.60.0070.03720.45
5.6.50.0070.03720.38
5.6.40.0030.04020.48
5.6.30.0030.04020.43
5.6.20.0030.04020.41
5.6.10.0030.04320.43
5.6.00.0030.04020.43
5.5.380.0100.04720.42
5.5.370.0030.04020.59
5.5.360.0000.04320.36
5.5.350.0030.04320.40
5.5.340.0070.03720.91
5.5.330.0100.08320.97
5.5.320.0070.08320.84
5.5.310.0170.05720.77
5.5.300.0000.04320.79
5.5.290.0100.04020.80
5.5.280.0100.03720.86
5.5.270.0130.03320.76
5.5.260.0000.04720.80
5.5.250.0030.04020.48
5.5.240.0030.04020.25
5.5.230.0000.04320.32
5.5.220.0100.03020.23
5.5.210.0100.03320.18
5.5.200.0030.04020.28
5.5.190.0000.04320.31
5.5.180.0000.04320.28
5.5.160.0030.03720.12
5.5.150.0030.04320.24
5.5.140.0030.04020.16
5.5.130.0070.07320.29
5.5.120.0100.05320.24
5.5.110.0130.06320.17
5.5.100.0030.07320.21
5.5.90.0100.06320.19
5.5.80.0030.07720.11
5.5.70.0070.08320.19
5.5.60.0130.07320.17
5.5.50.0100.07020.13
5.5.40.0100.07320.17
5.5.30.0030.04020.11
5.5.20.0100.08320.16
5.5.10.0100.04720.16
5.5.00.0130.06720.00
5.4.450.0000.04019.45
5.4.440.0000.04319.19
5.4.430.0030.04319.44
5.4.420.0070.04319.27
5.4.410.0100.03319.37
5.4.400.0000.04018.95
5.4.390.0000.05718.87
5.4.380.0070.03019.20
5.4.370.0000.04018.88
5.4.360.0030.03719.19
5.4.350.0030.04019.04
5.4.340.0070.03319.16
5.4.320.0030.04319.00
5.4.310.0130.03019.13
5.4.300.0030.03718.95
5.4.290.0100.04019.04
5.4.280.0000.05018.87
5.4.270.0100.07319.12
5.4.260.0070.07019.15
5.4.250.0230.03019.11
5.4.240.0030.07319.15
5.4.230.0070.07319.08
5.4.220.0070.08319.13
5.4.210.0130.06718.84
5.4.200.0070.07319.09
5.4.190.0070.06719.09
5.4.180.0070.07319.15
5.4.170.0100.07018.86
5.4.160.0100.07018.92
5.4.150.0100.06719.20
5.4.140.0000.07316.25
5.4.130.0030.06316.47
5.4.120.0030.07316.48
5.4.110.0030.03716.35
5.4.100.0030.07716.41
5.4.90.0130.07016.50
5.4.80.0070.07716.40
5.4.70.0070.07316.28
5.4.60.0100.07316.46
5.4.50.0100.06316.30
5.4.40.0070.06716.52
5.4.30.0030.06716.34
5.4.20.0070.04016.47
5.4.10.0070.07016.41
5.4.00.0130.04715.88
5.3.290.0030.03714.73
5.3.280.0070.07014.69
5.3.270.0030.04014.64
5.3.260.0070.08014.76
5.3.250.0070.04314.71
5.3.240.0100.06314.68
5.3.230.0030.07014.63
5.3.220.0030.07014.57
5.3.210.0030.06714.71
5.3.200.0070.06714.62
5.3.190.0130.07314.62
5.3.180.0030.07714.60
5.3.170.0170.06714.58
5.3.160.0070.04714.57
5.3.150.0100.07314.57
5.3.140.0070.06314.72
5.3.130.0030.08014.54
5.3.120.0100.05714.60
5.3.110.0070.07014.73
5.3.100.0100.05014.05
5.3.90.0100.05714.03
5.3.80.0000.08313.96
5.3.70.0030.06714.13
5.3.60.0030.07714.05
5.3.50.0030.04013.88
5.3.40.0100.06014.02
5.3.30.0070.06714.04
5.3.20.0000.05313.80
5.3.10.0030.04313.79
5.3.00.0000.08013.61

preferences:
35.92 ms | 401 KiB | 5 Q