3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class customException extends Exception { public function errorMessage() { $errorMsg = 'error on line ' .$this->getLine(). ' in '.$this->getFile().': <b>' .$this->geMessage().'</b> is not a valid e-mail address'; return $errorMsg; } } $emial = "someone@example.com"; try { if(filter_var($email, FILTER_VALIDATE_EMAIL) === false) { throw new customException($emial); } if(strpos($email,"example") !== FALSE) { throw new Exception("emial is an example e-mail"); } } catch (customException $e) { echo $e->errorMessage(); } catch(Excception $e) { echo $e->getMessage(); } ?>
based on MNKtt
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
Jump found. Position 1 = -2
Branch analysis from position: 13
Jump found. Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
Jump found. Position 1 = -2
Branch analysis from position: 23
Jump found. Position 1 = 33
Branch analysis from position: 33
Jump found. Position 1 = -2
Found catch point at position: 24
Branch analysis from position: 24
Jump found. Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
Jump found. Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 29
Jump found. Position 1 = 30, Position 2 = -2
Branch analysis from position: 30
Jump found. Position 1 = -2
Found catch point at position: 29
Branch analysis from position: 29
filename:       /in/Q4dRS
function name:  (null)
number of ops:  34
compiled vars:  !0 = $emial, !1 = $email, !2 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
         1        NOP                                                      
   9     2        ASSIGN                                                   !0, 'someone%40example.com'
  12     3        INIT_FCALL                                               'filter_var'
         4        SEND_VAR                                                 !1
         5        SEND_VAL                                                 274
         6        DO_ICALL                                         $6      
         7        IS_IDENTICAL                                     ~7      $6, <false>
         8      > JMPZ                                                     ~7, ->13
  13     9    >   NEW                                              $8      :0
        10        SEND_VAR_EX                                              !0
        11        DO_FCALL                                      0          
        12      > THROW                                         0          $8
  16    13    >   INIT_FCALL                                               'strpos'
        14        SEND_VAR                                                 !1
        15        SEND_VAL                                                 'example'
        16        DO_ICALL                                         $10     
        17        IS_NOT_IDENTICAL                                 ~11     $10, <false>
        18      > JMPZ                                                     ~11, ->23
  17    19    >   NEW                                              $12     :5
        20        SEND_VAL_EX                                              'emial+is+an+example+e-mail'
        21        DO_FCALL                                      0          
        22      > THROW                                         0          $12
        23    > > JMP                                                      ->33
  20    24  E > > CATCH                                                    'customException', !2, ->29
  21    25    >   INIT_METHOD_CALL                                         !2, 'errorMessage'
        26        DO_FCALL                                      0  $14     
        27        ECHO                                                     $14
        28      > JMP                                                      ->33
  24    29  E > > CATCH                                                    'Excception', !2
  25    30    >   INIT_METHOD_CALL                                         !2, 'getMessage'
        31        DO_FCALL                                      0  $15     
        32        ECHO                                                     $15
        33    > > RETURN                                                   1

Class customException:
Function errormessage:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/Q4dRS
function name:  errorMessage
number of ops:  15
compiled vars:  !0 = $errorMsg
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     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
         7        CONCAT                                           ~6      ~5, '%3A+%3Cb%3E'
         8        INIT_METHOD_CALL                                         'geMessage'
         9        DO_FCALL                                      0  $7      
        10        CONCAT                                           ~8      ~6, $7
        11        CONCAT                                           ~9      ~8, '%3C%2Fb%3E+is+not+a+valid+e-mail+address'
        12        ASSIGN                                                   !0, ~9
   5    13      > RETURN                                                   !0
   6    14*     > RETURN                                                   null

End of function errormessage

End of class customException.

Generated using Vulcan Logic Dumper, using php 7.1.0