3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); } ?>
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
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 27
2 jumps found. (Code = 107) Position 1 = 28, Position 2 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 27
Branch analysis from position: 27
filename:       /in/Q4dRS
function name:  (null)
number of ops:  32
compiled vars:  !0 = $emial, !1 = $email, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'someone%40example.com'
   12     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !1
          3        SEND_VAL                                                 274
          4        DO_ICALL                                         $4      
          5        TYPE_CHECK                                    4          $4
          6      > JMPZ                                                     ~5, ->11
   13     7    >   NEW                                              $6      'customException'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $6
   16    11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 'example'
         14        DO_ICALL                                         $8      
         15        TYPE_CHECK                                  1018          $8
         16      > JMPZ                                                     ~9, ->21
   17    17    >   NEW                                              $10     'Exception'
         18        SEND_VAL_EX                                              'emial+is+an+example+e-mail'
         19        DO_FCALL                                      0          
         20      > THROW                                         0          $10
         21    > > JMP                                                      ->31
   20    22  E > > CATCH                                                    'customException', ->27
   21    23    >   INIT_METHOD_CALL                                         !2, 'errorMessage'
         24        DO_FCALL                                      0  $12     
         25        ECHO                                                     $12
         26      > JMP                                                      ->31
   24    27  E > > CATCH                                       last         'Excception'
   25    28    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         29        DO_FCALL                                      0  $13     
         30        ECHO                                                     $13
   27    31    > > RETURN                                                   1

Class customException:
Function errormessage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) 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 8.0.0


preferences:
161.7 ms | 1405 KiB | 17 Q