3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Copyright By http://www.latestcode.net */ class PHP_Password_Generator{ public $password_length; public $password; private $numbers; private $alphabetic_chars; private $special_chars; private $password_type; public function __construct($type){ $this->password_type = $type; $this->numbers='0123456789'; $this->alphabetic_chars='abcdefghijklmnopqrstuvwxyz'; $this->special_chars='@#$%&!'; } /* Generate Password */ public function generate_password($length=8){ $this->password_length = ($length<1?8:$length); $this->password=''; switch($this->password_type){ default:{//Letters $password_characters = $this->alphabetic_chars; }break; } $password_characters = str_split($password_characters); shuffle($password_characters); for($i=0;$i<$this->password_length;$i++){ $this->password.=$password_characters[rand(0,count($password_characters)-1)]; } return $this->password; } /* Add custom special characters to the password */ public function set_special_characters($special_chars){ $this->special_chars = $special_chars; } } //Example 4: $pwd = new PHP_Password_Generator(4);//Make list of passwords for($x=0;$x<1358;$x++){ echo $pwd->generate_password(8).'<br/>'; }

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)
7.3.10.0040.01516.69
7.3.00.0030.01616.48
7.2.130.0090.00916.91
7.2.120.0040.01116.84
7.2.110.0110.00716.82
7.2.100.0100.01016.92
7.2.90.0100.01317.05
7.2.80.0140.00316.91
7.2.70.0070.01416.74
7.2.60.0060.00917.04
7.2.50.0030.01617.02
7.2.40.0060.01316.76
7.2.30.0060.01517.17
7.2.20.0070.01116.89
7.2.10.0130.01317.02
7.2.00.0050.01518.31
7.1.250.0030.01915.82
7.1.70.0060.00617.23
7.1.60.0130.02319.32
7.1.50.0230.02016.90
7.1.00.0000.08022.27
7.0.200.0030.01316.88
7.0.140.0030.08021.95
7.0.60.0030.08719.96
7.0.50.0130.07317.89
7.0.40.0100.05320.09
7.0.30.0270.06020.09
7.0.20.0130.06720.33
7.0.10.0270.05720.07
7.0.00.0000.05020.19
5.6.280.0170.07321.14
5.6.210.0130.03720.66
5.6.200.0130.06318.29
5.6.190.0100.09320.34
5.6.180.0270.07020.48
5.6.170.0230.09020.46
5.6.160.0230.08020.71
5.6.150.0000.09718.17
5.6.140.0100.04018.15
5.6.130.0070.10018.18
5.6.120.0130.04021.13
5.6.110.0100.09321.02
5.6.100.0130.09320.96
5.6.90.0170.09021.00
5.6.80.0130.08320.29
5.6.70.1670.05020.39
5.5.350.0100.09320.41
5.5.340.0100.04317.94
5.5.330.0070.04720.57
5.5.320.0530.09020.26
5.5.310.0300.08720.34
5.5.300.0100.06317.95
5.5.290.0100.08718.04
5.5.280.0030.09720.78
5.5.270.0070.04720.73
5.5.260.0130.06720.98
5.5.250.0070.05320.60
5.5.240.0070.09320.27
5.4.450.0500.07019.54
5.4.440.4030.05019.30
5.4.430.0200.04719.49
5.4.420.0270.04319.64
5.4.410.0300.07019.14
5.4.400.0330.07719.11
5.4.390.3270.05018.96
5.4.380.0200.06019.22
5.4.370.0200.07719.22
5.4.360.0030.05019.32
5.4.350.0500.03719.08
5.4.340.0170.04719.07
5.4.320.0300.08318.99
5.4.310.0530.03319.22
5.4.300.0430.05719.00
5.4.290.0100.08318.84
5.4.280.0570.06719.20
5.4.270.0400.06319.22
5.4.260.0270.04719.21
5.4.250.0300.07718.99
5.4.240.0300.08019.13
5.4.230.0200.06719.21
5.4.220.0400.05319.24
5.4.210.0300.08319.21
5.4.200.0300.08019.13
5.4.190.0230.08019.16
5.4.180.0500.05719.08
5.4.170.3330.04318.86
5.4.160.0230.07019.29
5.4.150.4030.05019.04
5.4.140.4230.05016.32
5.4.130.0200.04316.47
5.4.120.0300.03316.36
5.4.110.0230.08016.45
5.4.100.0130.07716.38
5.4.90.0230.07316.57
5.4.80.0000.05016.24
5.4.70.0070.08316.55
5.4.60.0330.04316.49
5.4.50.0030.07016.35
5.4.40.0130.03016.51
5.4.30.0200.05016.52
5.4.20.0270.08016.26
5.4.10.3570.04016.51
5.4.00.2730.05015.78

preferences:
33.87 ms | 400 KiB | 5 Q