3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IValidation_Rule { public function validate($value); } class EMail_Rule implements IValidation_Rule { public function validate($email) { if(!is_string($email)) return false; return preg_match("/^.+@.+\..+$/", $email); } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EHDZp
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'email_rule'
   19     1      > RETURN                                                   1

Class IValidation_Rule:
Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EHDZp
function name:  validate
number of ops:  2
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function validate

End of class IValidation_Rule.

Class EMail_Rule:
Function validate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EHDZp
function name:  validate
number of ops:  11
compiled vars:  !0 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        TYPE_CHECK                                   64  ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->5
   13     4    > > RETURN                                                   <false>
   15     5    >   INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%2F%5E.%2B%40.%2B%5C..%2B%24%2F'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9      > RETURN                                                   $3
   16    10*     > RETURN                                                   null

End of function validate

End of class EMail_Rule.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.27 ms | 1395 KiB | 15 Q