3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DISPLAY_ERRORS', true); define('DISPLAY_EXCEPTIONS', true); set_time_limit(0); ini_set('memory_limit',-1); ini_set('max_execution_time',0); ini_set('ignore_user_abort','On'); ini_set('display_errors', (DISPLAY_ERRORS)?(1):(0)); ini_set('display_startup_errors', (DISPLAY_ERRORS)?(1):(0)); error_reporting((DISPLAY_ERRORS)?(1):(0)); ignore_user_abort (true); date_default_timezone_set('America/Tegucigalpa'); require_once 'SMTP4PHP.php'; //use SMTP4PHP\User; //use SMTP4PHP\eMail; //use SMTP4PHP\SMTP; class enviarEmail{ private $servidor; private $puerto; private $cuenta_correo; private $contrasena; private $nombre; private $remitente; private $emailServer = NULL; private $smtp = NULL; public function __construct($servidor, $puerto, $cuenta_correo, $contrasena, $nombre){ $this->servidor = $servidor; $this->puerto = $puerto; $this->cuenta_correo = $cuenta_correo; $this->contrasena = $contrasena; $this->nombre = $nombre; $this->remitente = $cuenta_correo; $this->servidor_init(); $this->smtp_init(); } private function servidor_init(){ $this->emailServer = new eMail(); } private function smtp_init(){ $this->smtp = new SMTP($this->servidor, $this->puerto, $this->cuenta_correo, $this->contrasena); } public function enviarLink($correo, $Link){ $this->emailServer->from = new User($this->nombre, $this->remitente); $this->emailServer->to = new User($this->nombre, $correo); $this->emailServer->subject = FROM_SUBJECT; $this->emailServer->htmlMessage = 'Se ha generado su formulario PreImpreso. Tiene '. VALIDEZ_URL .' horas a partir de ahora para descarga el documento y solo tiene vigencia para ser descargado ' . REQUEST_PER_LINK . ' veces. Link para descargar -> ' . $Link; try { $this->smtp->send($this->emailServer); /* O $smtp->send($e,$e2);*/ return true; } catch(Exception $e) { return false; } } public function errorLog(){ echo var_dump($this->smtp->SMTPlog); } } ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Failed opening required 'SMTP4PHP.php' (include_path='.:') in /in/sDjiU:15 Stack trace: #0 {main} thrown in /in/sDjiU on line 15
Process exited with code 255.
Output for 5.4.38 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33

Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.37
Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 6 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 7 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 8 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 9 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 6 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 7 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 8 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 9 Warning: ini_set() has been disabled for security reasons in /in/sDjiU on line 10 Fatal error: Call to undefined function date_default_timezone_set() in /in/sDjiU on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sDjiU on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sDjiU on line 22
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/sDjiU on line 22
Process exited with code 255.

preferences:
271.65 ms | 401 KiB | 310 Q