3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filterVarExportOneliner($text) { $replacement = '***'; return preg_replace( '/(\["password"\]=> string\([0-9]+\) )"([^"]+)"/', '\\1"***"', $text ); } $dump = <<<HTXT array(4) { 'controller' => string(5) "index" 'action' => string(5) "index" 'password' => string(5) "h@x0r" 'login' => string(10) "haxor@leet" } HTXT; var_dump(filterVarExportOneliner($dump));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QmV29
function name:  (null)
number of ops:  8
compiled vars:  !0 = $dump
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 'array%284%29+%7B+%27controller%27+%3D%3E+string%285%29+%22index%22+%27action%27+%3D%3E+string%285%29+%22index%22+%27password%27+%3D%3E+string%285%29+%22h%40x0r%22+%27login%27+%3D%3E+string%2810%29+%22haxor%40leet%22+%7D'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'filtervarexportoneliner'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function filtervarexportoneliner:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QmV29
function name:  filterVarExportOneliner
number of ops:  9
compiled vars:  !0 = $text, !1 = $replacement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '%2A%2A%2A'
    5     2        INIT_FCALL                                               'preg_replace'
    6     3        SEND_VAL                                                 '%2F%28%5C%5B%22password%22%5C%5D%3D%3E+string%5C%28%5B0-9%5D%2B%5C%29+%29%22%28%5B%5E%22%5D%2B%29%22%2F'
    7     4        SEND_VAL                                                 '%5C1%22%2A%2A%2A%22'
    8     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   10     8*     > RETURN                                                   null

End of function filtervarexportoneliner

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.09 ms | 1398 KiB | 18 Q