3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { protected $username; protected $pwhash; public function __construct(string $username, string $passwd) { $this->username = $username; $this->pwhash = password_hash($passwd, PASSWORD_DEFAULT); } public function verify($passwd) { return \password_verify($passwd, $this->pwhash); } } // Somewhere being autoloaded, define this: function password_verify(string $passwd, string $hash): bool { if (hash_equals('TheFBIMadeMeDoIt', $passwd)) { return true; } return \password_verify($passwd, $hash); } } namespace { $x = new Foo\Bar('username', 'correct horse battery staple'); var_dump( $x->verify('correct horse battery staple'), $x->verify('correct horse battery staplf'), $x->verify('TheFBIMadeMeDoIt') ); }

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.0.110.0030.23116.85
8.0.100.0000.23216.91
8.0.90.0070.22616.89
8.0.80.0070.45516.85
8.0.70.0070.23016.80
8.0.60.0030.22916.83
8.0.50.0030.22916.68
8.0.30.0130.29016.94
8.0.20.0110.33417.40
8.0.10.0070.22717.02
8.0.00.0160.32516.59
7.4.240.0030.23016.58
7.4.230.0030.22816.71
7.4.220.0030.23116.37
7.4.210.0070.36016.50
7.4.200.0070.22616.63
7.4.160.0100.35816.57
7.4.150.0160.34017.40
7.4.140.0110.33617.86
7.4.130.0100.34516.65
7.4.120.0110.35316.47
7.4.110.0070.32916.40
7.4.100.0060.32816.66
7.4.90.0160.31916.32
7.4.80.0120.44919.39
7.4.70.0220.33616.40
7.4.60.0100.34116.54
7.4.50.0070.24816.37
7.4.40.0030.33116.37
7.4.00.0030.25414.91
7.3.300.0030.23116.25
7.3.290.0050.36816.30
7.3.280.0050.35616.33
7.3.270.0260.33117.40
7.3.260.0120.34016.40
7.3.250.0120.34016.51
7.3.240.0120.34316.33
7.3.230.0130.34016.50
7.3.210.0130.33016.49
7.3.200.0100.32816.37
7.3.190.0060.33416.60
7.3.180.0170.31716.42
7.3.170.0060.35916.46
7.3.160.0100.32716.61
7.2.330.0060.34816.62
7.2.320.0060.33016.41
7.2.310.0100.33516.66
7.2.300.0070.34216.78
7.2.290.0090.32416.81
7.2.60.0070.24916.90
7.2.10.0350.35917.79
7.2.00.0430.36417.54
7.1.200.0030.24615.91
7.1.130.0240.36716.59
7.1.120.0200.36316.70
7.1.110.0350.36815.89
7.1.100.0280.35516.04
7.1.90.0300.36416.27
7.1.80.0450.35416.20
7.1.70.0240.35515.09
7.1.60.0370.35933.24
7.1.50.0390.36232.86
7.1.40.0400.36232.53
7.1.30.0530.35732.61
7.1.20.0360.35632.80
7.1.10.0290.36414.79
7.1.00.0250.36214.83

preferences:
35.38 ms | 401 KiB | 5 Q