3v4l.org

run code in 300+ PHP versions simultaneously
<?php class customException extends Exception { public function errorMessage() { //error message $errorMsg = 'Error on line '.$this->getLine().' in '.$this->getFile() .': <b>'.$this->getMessage().'</b> is not a valid E-Mail address'; return $errorMsg; } } $email = "someone@example...com"; try { //check if if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) { //throw exception if email is not valid throw new customException($email); } } catch (customException $e) { //display custom message echo $e->errorMessage(); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oDiKP
function name:  (null)
number of ops:  17
compiled vars:  !0 = $email, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'someone%40example...com'
   18     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 274
          4        DO_ICALL                                         $3      
          5        TYPE_CHECK                                    4          $3
          6      > JMPZ                                                     ~4, ->11
   21     7    >   NEW                                              $5      'customException'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $5
         11    > > JMP                                                      ->16
   25    12  E > > CATCH                                       last         'customException'
   28    13    >   INIT_METHOD_CALL                                         !1, 'errorMessage'
         14        DO_FCALL                                      0  $7      
         15        ECHO                                                     $7
   30    16    > > RETURN                                                   1

Class customException:
Function errormessage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oDiKP
function name:  errorMessage
number of ops:  15
compiled vars:  !0 = $errorMsg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'getLine'
          1        DO_FCALL                                      0  $1      
          2        CONCAT                                           ~2      'Error+on+line+', $1
          3        CONCAT                                           ~3      ~2, '+in+'
          4        INIT_METHOD_CALL                                         'getFile'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      ~3, $4
    8     7        CONCAT                                           ~6      ~5, '%3A+%3Cb%3E'
          8        INIT_METHOD_CALL                                         'getMessage'
          9        DO_FCALL                                      0  $7      
         10        CONCAT                                           ~8      ~6, $7
         11        CONCAT                                           ~9      ~8, '%3C%2Fb%3E+is+not+a+valid+E-Mail+address'
    7    12        ASSIGN                                                   !0, ~9
    9    13      > RETURN                                                   !0
   10    14*     > RETURN                                                   null

End of function errormessage

End of class customException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.23 ms | 1401 KiB | 15 Q