3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Validator { public static function go($str) { if (mb_strlen($str) < 3) { return false; } return preg_match('/^([A-Za-z0-9_\s]+)$/', $str) == 1; } } var_dump(Validator::go("abc"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SgCbV
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Validator', 'go'
          2        SEND_VAL                                                 'abc'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class Validator:
Function go:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SgCbV
function name:  go
number of ops:  14
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        IS_SMALLER                                               $1, 3
          5      > JMPZ                                                     ~2, ->7
    8     6    > > RETURN                                                   <false>
   11     7    >   INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%2F%5E%28%5BA-Za-z0-9_%5Cs%5D%2B%29%24%2F'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        IS_EQUAL                                         ~4      $3, 1
         12      > RETURN                                                   ~4
   12    13*     > RETURN                                                   null

End of function go

End of class Validator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.06 ms | 1395 KiB | 19 Q