3v4l.org

run code in 300+ PHP versions simultaneously
<?php // SHOULD PASS. Passes all 5.0.5 and thereafter. $passwordTestArray[] = 'Aa'; // SHOULD PASS. Passes all 5.0.5 and thereafter. $passwordTestArray[] = 'Æa'; // SHOULD PASS. Fails after 5.2.10. Passes 5.0.5 - 5.2.9 $passwordTestArray[] = 'Aæ'; // SHOULD PASS. Fails after 5.2.10. Passes 5.0.5 - 5.2.9 $passwordTestArray[] = 'Ææ'; // SHOULD FAIL because ß does not have an uppercase equiv. But it passses anyway in 5.0.5 - 5.2.9 $passwordTestArray[] = 'Aß'; // SHOULD FAIL because there is no uppercase ß. // It fails for the wrong reasons in 5.0.5 - 5.2.9 // It passes in 5.2.10 and beyond. $passwordTestArray[] = 'aß'; class PCREFail { static public function verifyComplexity($plainTextPassword) { $re = "/(?=.*[\\p{Ll}])(?=.*[\\p{Lu}]).{2,}/"; $found = preg_match_all($re, $plainTextPassword, $matches); if ($found) { return $matches; } return $found; } } foreach ($passwordTestArray as $passwordToTest) { var_dump(PCREFail::verifyComplexity($passwordToTest)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/hCcqj
function name:  (null)
number of ops:  23
compiled vars:  !0 = $passwordTestArray, !1 = $passwordToTest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  'Aa'
    5     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  '%C3%86a'
    7     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  'A%C3%A6'
    9     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  '%C3%86%C3%A6'
   11     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  'A%C3%9F'
   17    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  'a%C3%9F'
   34    12      > FE_RESET_R                                       $8      !0, ->21
         13    > > FE_FETCH_R                                               $8, !1, ->21
   35    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_STATIC_METHOD_CALL                                  'PCREFail', 'verifyComplexity'
         16        SEND_VAR                                                 !1
         17        DO_FCALL                                      0  $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                                 
   34    20      > JMP                                                      ->13
         21    >   FE_FREE                                                  $8
   36    22      > RETURN                                                   1

Class PCREFail:
Function verifycomplexity:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hCcqj
function name:  verifyComplexity
number of ops:  12
compiled vars:  !0 = $plainTextPassword, !1 = $re, !2 = $found, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN                                                   !1, '%2F%28%3F%3D.%2A%5B%5Cp%7BLl%7D%5D%29%28%3F%3D.%2A%5B%5Cp%7BLu%7D%5D%29.%7B2%2C%7D%2F'
   25     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !3
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   26     8      > JMPZ                                                     !2, ->10
   27     9    > > RETURN                                                   !3
   29    10    > > RETURN                                                   !2
   30    11*     > RETURN                                                   null

End of function verifycomplexity

End of class PCREFail.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.1 ms | 1400 KiB | 17 Q