3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Il n'y a pas d'accent, devait être correct \n"; $pattern = '/^[A-Za-z0-9-_\.]*$/'; $string = 'Il-etait-une-fois-9-canards'.PHP_EOL; printf(" Résultat: %s\n", preg_match($pattern, $string) ? 'Correct!' : 'Oups; incorrect') ; echo "Cette fois il y a un accent, incorrect \n"; $pattern = '/^[A-Za-z0-9-_\.]*$/'; $string = 'Il-était-une-fois-9-canards'; printf(" Résultat: %s\n", preg_match($pattern, $string) ? 'Correct!' : 'Oups; incorrect') ;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
filename:       /in/Wr6nm
function name:  (null)
number of ops:  31
compiled vars:  !0 = $pattern, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Il+n%27y+a+pas+d%27accent%2C+devait+%C3%AAtre+correct+%0A'
    6     1        ASSIGN                                                   !0, '%2F%5E%5BA-Za-z0-9-_%5C.%5D%2A%24%2F'
    7     2        ASSIGN                                                   !1, 'Il-etait-une-fois-9-canards%0A'
    9     3        INIT_FCALL                                               'printf'
          4        SEND_VAL                                                 '+++R%C3%A9sultat%3A+%25s%0A'
          5        INIT_FCALL                                               'preg_match'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9      > JMPZ                                                     $4, ->12
         10    >   QM_ASSIGN                                        ~5      'Correct%21'
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~5      'Oups%3B+incorrect'
         13    >   SEND_VAL                                                 ~5
         14        DO_ICALL                                                 
   11    15        ECHO                                                     'Cette+fois+il+y+a+un+accent%2C+incorrect+%0A'
   13    16        ASSIGN                                                   !0, '%2F%5E%5BA-Za-z0-9-_%5C.%5D%2A%24%2F'
   14    17        ASSIGN                                                   !1, 'Il-%C3%A9tait-une-fois-9-canards'
   16    18        INIT_FCALL                                               'printf'
         19        SEND_VAL                                                 '+++R%C3%A9sultat%3A+%25s%0A'
         20        INIT_FCALL                                               'preg_match'
         21        SEND_VAR                                                 !0
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $9      
         24      > JMPZ                                                     $9, ->27
         25    >   QM_ASSIGN                                        ~10     'Correct%21'
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~10     'Oups%3B+incorrect'
         28    >   SEND_VAL                                                 ~10
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.83 ms | 1002 KiB | 15 Q