3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Class MailerBootstrap */ class MailerBootstrap { /** * @var string * Hostname */ private $smtp; /** * @var int * TCP Port for SMTP */ private $port; /** * @var string * SMTP Username */ private $username; /** * @var string * SMTP Password */ private $password; /** * MailerBootstrap constructor. * @param string $smtp * @param int $port * @param string $username * @param string $password * Collects SMTP Info */ public function __construct(string $smtp, int $port, string $username, string $password) { $this->smtp = $smtp; $this->port = $port; $this->username = $username; $this->password = $password; } /** * @return Swift_SmtpTransport * Initializes Swift_SmtpTransport Class */ private function buildTransport(): Swift_SmtpTransport { return (new Swift_SmtpTransport($this->smtp, $this->port)) ->setUsername($this->username) ->setPassword($this->password); } /** * @return Swift_Mailer * Initializes Swift_Mailer Class */ private function buildMailer(): Swift_Mailer { return new Swift_Mailer($this->buildTransport()); } /** * @param string $subject * @param array $from * @param array $to * @param string $body * @return Swift_Message * Builds the Message */ private function buildMessage(?string $subject = null, ?array $from = null, ?array $to = null, ?string $body = null): Swift_Message { return (new Swift_Message($subject)) ->setFrom($from) ->setTo($to) ->setBody($body); } /** * Sends the Message */ public function send(): void { $this->buildMailer()->send($this->buildMessage()); } }

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.70.0000.01416.63
8.3.60.0070.01118.55
8.3.50.0060.00817.96
8.3.40.0040.01118.72
8.3.30.0070.00718.54
8.3.20.0000.00819.15
8.3.10.0040.00423.65
8.3.00.0090.00620.75
8.2.190.0100.00616.58
8.2.180.0140.00718.18
8.2.170.0030.01222.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00317.84
8.2.120.0070.00026.35
8.2.110.0100.00020.78
8.2.100.0000.01017.78
8.2.90.0030.00617.72
8.2.80.0050.00517.97
8.2.70.0000.00817.79
8.2.60.0030.00617.91
8.2.50.0040.00418.10
8.2.40.0040.00421.07
8.2.30.0000.00719.20
8.2.20.0050.00218.02
8.2.10.0030.00517.94
8.2.00.0040.00417.45
8.1.280.0150.00625.92
8.1.270.0030.00523.99
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0050.00520.79
8.1.230.0040.00720.96
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0070.00517.23
8.1.190.0000.00817.10
8.1.180.0040.00418.10
8.1.170.0030.00518.52
8.1.160.0000.00718.66
8.1.150.0000.00718.70
8.1.140.0070.00022.08
8.1.130.0030.00619.03
8.1.120.0000.00817.25
8.1.110.0000.00717.34
8.1.100.0000.00717.34
8.1.90.0000.00717.39
8.1.80.0060.00317.34
8.1.70.0070.00017.38
8.1.60.0000.00817.31
8.1.50.0040.00417.49
8.1.40.0000.00817.41
8.1.30.0040.00417.60
8.1.20.0000.00717.42
8.1.10.0000.00717.44
8.1.00.0000.00717.35
8.0.300.0000.00719.90
8.0.290.0000.00916.58
8.0.280.0070.00018.21
8.0.270.0030.00717.15
8.0.260.0030.00316.71
8.0.250.0060.00016.81
8.0.240.0060.00016.89
8.0.230.0000.00716.83
8.0.220.0040.00416.70
8.0.210.0030.00616.83
8.0.200.0000.00616.78
8.0.190.0000.00816.82
8.0.180.0080.00016.77
8.0.170.0000.00916.82
8.0.160.0030.00516.87
8.0.150.0100.00016.77
8.0.140.0030.00616.74
8.0.130.0000.00513.17
8.0.120.0050.00316.77
8.0.110.0000.00816.82
8.0.100.0040.00416.65
8.0.90.0040.00416.77
8.0.80.0120.00916.81
8.0.70.0070.00016.68
8.0.60.0000.00716.82
8.0.50.0000.00816.85
8.0.30.0100.01216.90
8.0.20.0110.00717.40
8.0.10.0080.00016.70
8.0.00.0100.01216.56
7.4.330.0030.00315.55
7.4.320.0000.00716.41
7.4.300.0080.00016.38
7.4.290.0040.00416.41
7.4.280.0060.00316.48
7.4.270.0000.00716.50
7.4.260.0040.00416.40
7.4.250.0000.00716.37
7.4.240.0000.00716.41
7.4.230.0040.00416.24
7.4.220.0060.00316.47
7.4.210.0090.00816.47
7.4.200.0070.00016.29
7.4.160.0110.00716.35
7.4.140.0090.01217.86
7.4.130.0060.01116.50
7.4.120.0070.01116.40
7.4.110.0090.00916.40
7.4.100.0120.00916.59
7.4.90.0130.00316.47
7.4.80.0030.01319.39
7.4.70.0090.00916.32
7.4.60.0120.00616.32
7.4.50.0080.00816.43
7.4.40.0070.01016.09
7.4.00.0000.00915.04
7.3.330.0030.00313.16
7.3.320.0000.00513.05
7.3.310.0030.00316.16
7.3.300.0000.00716.23
7.3.290.0060.00016.17
7.3.280.0080.01016.17
7.3.260.0100.01116.17
7.3.240.0070.01016.37
7.3.230.0120.00616.48
7.3.210.0090.00616.34
7.3.200.0080.00816.39
7.3.190.0100.00816.52
7.3.180.0140.00316.34
7.3.170.0160.00716.28
7.3.160.0090.00616.35
7.2.330.0060.01216.43
7.2.320.0090.00916.51
7.2.310.0100.01416.52
7.2.300.0130.01016.59
7.2.290.0100.00716.50
7.2.110.0190.01014.46
7.2.100.0440.01414.62
7.2.90.0250.00714.46
7.2.80.1140.00914.61
7.2.70.0220.00814.32
7.2.60.0250.00614.78
7.2.50.0280.01014.63
7.2.40.0200.01314.68
7.2.30.0230.01514.74
7.2.20.0470.00014.68
7.2.10.0290.00714.45
7.2.00.0420.01014.71
7.1.230.0260.00313.61
7.1.220.0190.01013.61
7.1.210.0310.01013.54
7.1.200.0240.00613.67
7.1.190.0270.01013.71
7.1.180.0310.00613.55
7.1.170.0380.00613.55
7.1.160.0260.00713.66
7.1.150.0270.00713.63
7.1.140.0420.01013.37
7.1.130.0200.01313.39
7.1.120.0340.00313.61
7.1.110.0370.00613.79
7.1.100.0250.00413.65
7.1.90.0310.00313.42
7.1.80.0340.00713.62
7.1.70.0220.00613.70
7.1.60.0470.02331.90
7.1.50.0370.01231.42
7.1.40.0490.00331.96
7.1.30.0510.00931.43
7.1.20.0590.01731.79
7.1.10.1380.01313.69
7.1.00.0290.01013.45
5.6.380.0120.00313.88

preferences:
46.91 ms | 401 KiB | 5 Q