3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Mail { public $myMail; private $errors = array(); public function send(){ if(!$this->myMail){ $this->errors[] = 'myMail is not defined'; return FALSE; } return TRUE; } public function getErrors(){ if(count($this->errors)>0){ return $this->errors; } return NULL; } } $mail = new Mail(); //$mail->myMail = 'test@test.com'; $snd = $mail->send(); if($mail->getErrors()){ foreach($mail->errors() as $error){ echo "$error<br>"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 18
filename:       /in/3Hl18
function name:  (null)
number of ops:  19
compiled vars:  !0 = $mail, !1 = $snd, !2 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $3      'Mail'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   32     3        INIT_METHOD_CALL                                         !0, 'send'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   34     6        INIT_METHOD_CALL                                         !0, 'getErrors'
          7        DO_FCALL                                      0  $8      
          8      > JMPZ                                                     $8, ->18
   35     9    >   INIT_METHOD_CALL                                         !0, 'errors'
         10        DO_FCALL                                      0  $9      
         11      > FE_RESET_R                                       $10     $9, ->17
         12    > > FE_FETCH_R                                               $10, !2, ->17
   36    13    >   NOP                                                      
         14        FAST_CONCAT                                      ~11     !2, '%3Cbr%3E'
         15        ECHO                                                     ~11
   35    16      > JMP                                                      ->12
         17    >   FE_FREE                                                  $10
   38    18    > > RETURN                                                   1

Class Mail:
Function send:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Hl18
function name:  send
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'myMail'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->7
   12     3    >   FETCH_OBJ_W                                      $2      'errors'
          4        ASSIGN_DIM                                               $2
          5        OP_DATA                                                  'myMail+is+not+defined'
   13     6      > RETURN                                                   <false>
   16     7    > > RETURN                                                   <true>
   18     8*     > RETURN                                                   null

End of function send

Function geterrors:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Hl18
function name:  getErrors
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'errors'
          1        COUNT                                            ~1      ~0
          2        IS_SMALLER                                               0, ~1
          3      > JMPZ                                                     ~2, ->6
   22     4    >   FETCH_OBJ_R                                      ~3      'errors'
          5      > RETURN                                                   ~3
   24     6    > > RETURN                                                   null
   25     7*     > RETURN                                                   null

End of function geterrors

End of class Mail.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.64 ms | 944 KiB | 14 Q