3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class User { public function filterName($fullName) { return filter_var($fullName, FILTER_CALLBACK, ['options'=>function($value) { $value = trim($value); // strip tags $value = strip_tags($value); // remove double quotes $value = preg_replace('/["<>\{\}\[\]]+/', '', $value); return $value; }]); } } $user = new User; echo $user->filterName('Foo!"bar" Baz ø hello!<strong>poop</strong>') . "\n"; echo $user->filterName('@непроизносимые 誤解 की اللغويات') . "\n";
based on LHNTT
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FuZZF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $user
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  17     1        NEW                                              $2      :-5
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
  18     4        INIT_METHOD_CALL                                         !0, 'filterName'
         5        SEND_VAL_EX                                              'Foo%21%22bar%22+Baz+%C3%B8+hello%21%3Cstrong%3Epoop%3C%2Fstrong%3E'
         6        DO_FCALL                                      0  $5      
         7        CONCAT                                           ~6      $5, '%0A'
         8        ECHO                                                     ~6
  19     9        INIT_METHOD_CALL                                         !0, 'filterName'
        10        SEND_VAL_EX                                              '%40%D0%BD%D0%B5%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%D0%BC%D1%8B%D0%B5+%E8%AA%A4%E8%A7%A3+%E0%A4%95%E0%A5%80+%D8%A7%D9%84%D9%84%D8%BA%D9%88%D9%8A%D8%A7%D8%AA'
        11        DO_FCALL                                      0  $7      
        12        CONCAT                                           ~8      $7, '%0A'
        13        ECHO                                                     ~8
        14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFuZZF0x7fc105a0b185:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FuZZF
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $value
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   RECV                                             !0      
   7     1        INIT_FCALL                                               'trim'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                         $1      
         4        ASSIGN                                                   !0, $1
   9     5        INIT_FCALL                                               'strip_tags'
         6        SEND_VAR                                                 !0
         7        DO_ICALL                                         $3      
         8        ASSIGN                                                   !0, $3
  11     9        INIT_FCALL                                               'preg_replace'
        10        SEND_VAL                                                 '%2F%5B%22%3C%3E%5C%7B%5C%7D%5C%5B%5C%5D%5D%2B%2F'
        11        SEND_VAL                                                 ''
        12        SEND_VAR                                                 !0
        13        DO_ICALL                                         $5      
        14        ASSIGN                                                   !0, $5
  12    15      > RETURN                                                   !0
  13    16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFuZZF0x7fc105a0b185

Class User:
Function filtername:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FuZZF
function name:  filterName
number of ops:  10
compiled vars:  !0 = $fullName
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   RECV                                             !0      
   6     1        INIT_FCALL                                               'filter_var'
         2        SEND_VAR                                                 !0
         3        SEND_VAL                                                 1024
         4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFuZZF0x7fc105a0b185'
  13     5        INIT_ARRAY                                       ~2      ~1, 'options'
         6        SEND_VAL                                                 ~2
         7        DO_ICALL                                         $3      
         8      > RETURN                                                   $3
  14     9*     > RETURN                                                   null

End of function filtername

End of class User.

Generated using Vulcan Logic Dumper, using php 7.3.0