3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = ""; function isNice($str) { if( strpos($str, "ab") !== false || strpos($str, "cd") !== false || strpos($str, "pq") !== false || strpos($str, "xy") !== false ) { return false; } if( 3 > preg_match_all("/[aeiou]/i", $str, $match) || !preg_match("/([a-z])\\1/i", $str) ) { return false; } return true; } var_dump(isNice("jchzalrnumimnmhp"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pl652
function name:  (null)
number of ops:  8
compiled vars:  !0 = $in
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
   25     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'isnice'
          3        SEND_VAL                                                 'jchzalrnumimnmhp'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function isnice:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 47) Position 1 = 36, Position 2 = 42
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 27
Branch analysis from position: 20
Branch analysis from position: 13
filename:       /in/pl652
function name:  isNice
number of ops:  46
compiled vars:  !0 = $str, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'ab'
          4        DO_ICALL                                         $2      
          5        TYPE_CHECK                                  1018  ~3      $2
          6      > JMPNZ_EX                                         ~3      ~3, ->13
    8     7    >   INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'cd'
         10        DO_ICALL                                         $4      
         11        TYPE_CHECK                                  1018  ~5      $4
         12        BOOL                                             ~3      ~5
         13    > > JMPNZ_EX                                         ~3      ~3, ->20
    9    14    >   INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 'pq'
         17        DO_ICALL                                         $6      
         18        TYPE_CHECK                                  1018  ~7      $6
         19        BOOL                                             ~3      ~7
         20    > > JMPNZ_EX                                         ~3      ~3, ->27
   10    21    >   INIT_FCALL                                               'strpos'
         22        SEND_VAR                                                 !0
         23        SEND_VAL                                                 'xy'
         24        DO_ICALL                                         $8      
         25        TYPE_CHECK                                  1018  ~9      $8
         26        BOOL                                             ~3      ~9
         27    > > JMPZ                                                     ~3, ->29
   12    28    > > RETURN                                                   <false>
   16    29    >   INIT_FCALL                                               'preg_match_all'
         30        SEND_VAL                                                 '%2F%5Baeiou%5D%2Fi'
         31        SEND_VAR                                                 !0
         32        SEND_REF                                                 !1
         33        DO_ICALL                                         $10     
         34        IS_SMALLER                                       ~11     $10, 3
         35      > JMPNZ_EX                                         ~11     ~11, ->42
   17    36    >   INIT_FCALL                                               'preg_match'
         37        SEND_VAL                                                 '%2F%28%5Ba-z%5D%29%5C1%2Fi'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $12     
         40        BOOL_NOT                                         ~13     $12
         41        BOOL                                             ~11     ~13
         42    > > JMPZ                                                     ~11, ->44
   19    43    > > RETURN                                                   <false>
   22    44    > > RETURN                                                   <true>
   23    45*     > RETURN                                                   null

End of function isnice

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.64 ms | 1403 KiB | 22 Q