3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = -2
filename:       /in/SgCbV
function name:  (null)
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  15     1        INIT_FCALL                                               'var_dump'
         2        INIT_STATIC_METHOD_CALL                                  'Validator', 'go'
         3        SEND_VAL_EX                                              'abc'
         4        DO_FCALL                                      0  $1      
         5        SEND_VAR                                                 $1
         6        DO_ICALL                                                 
         7      > RETURN                                                   1

Class Validator:
Function go:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
Jump found. Position 1 = -2
Branch analysis from position: 7
Jump found. 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                                       ~2      $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 7.3.0