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()); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   95     0  E > > RETURN                                                   1

Class MailerBootstrap:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  __construct
number of ops:  13
compiled vars:  !0 = $smtp, !1 = $port, !2 = $username, !3 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   44     4        ASSIGN_OBJ                                               'smtp'
          5        OP_DATA                                                  !0
   45     6        ASSIGN_OBJ                                               'port'
          7        OP_DATA                                                  !1
   46     8        ASSIGN_OBJ                                               'username'
          9        OP_DATA                                                  !2
   47    10        ASSIGN_OBJ                                               'password'
         11        OP_DATA                                                  !3
   48    12      > RETURN                                                   null

End of function __construct

Function buildtransport:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  buildTransport
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   NEW                                              $0      'Swift_SmtpTransport'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $1      'smtp'
          3        SEND_FUNC_ARG                                            $1
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $2      'port'
          6        SEND_FUNC_ARG                                            $2
          7        DO_FCALL                                      0          
   57     8        INIT_METHOD_CALL                                         $0, 'setUsername'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_OBJ_FUNC_ARG                               $4      'username'
         11        SEND_FUNC_ARG                                            $4
         12        DO_FCALL                                      0  $5      
   58    13        INIT_METHOD_CALL                                         $5, 'setPassword'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_OBJ_FUNC_ARG                               $6      'password'
         16        SEND_FUNC_ARG                                            $6
         17        DO_FCALL                                      0  $7      
         18        VERIFY_RETURN_TYPE                                       $7
         19      > RETURN                                                   $7
   59    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function buildtransport

Function buildmailer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  buildMailer
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   NEW                                              $0      'Swift_Mailer'
          1        INIT_METHOD_CALL                                         'buildTransport'
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR_NO_REF_EX                                       $1
          4        DO_FCALL                                      0          
          5        VERIFY_RETURN_TYPE                                       $0
          6      > RETURN                                                   $0
   68     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function buildmailer

Function buildmessage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  buildMessage
number of ops:  20
compiled vars:  !0 = $subject, !1 = $from, !2 = $to, !3 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
          3        RECV_INIT                                        !3      null
   80     4        NEW                                              $4      'Swift_Message'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   81     7        INIT_METHOD_CALL                                         $4, 'setFrom'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $6      
   82    10        INIT_METHOD_CALL                                         $6, 'setTo'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $7      
   83    13        INIT_METHOD_CALL                                         $7, 'setBody'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $8      
         16        VERIFY_RETURN_TYPE                                       $8
         17      > RETURN                                                   $8
   84    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function buildmessage

Function send:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6qX
function name:  send
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   92     0  E >   INIT_METHOD_CALL                                         'buildMailer'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'send'
          3        INIT_METHOD_CALL                                         'buildMessage'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR_NO_REF_EX                                       $1
          6        DO_FCALL                                      0          
   93     7      > RETURN                                                   null

End of function send

End of class MailerBootstrap.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.16 ms | 1407 KiB | 13 Q