3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sweet = ['a' => 'apple ', 'b' => ' "banana" ']; $array = ['sweet' => $sweet, 'test' => " <a href='test'>Test</a>"]; function mySanitizer(&$value) { $value = htmlspecialchars(trim($value)); } array_walk_recursive($array, 'mySanitizer'); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iIATr
function name:  (null)
number of ops:  12
compiled vars:  !0 = $sweet, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_ARRAY                                       ~3      !0, 'sweet'
          2        ADD_ARRAY_ELEMENT                                ~3      '+%3Ca+href%3D%27test%27%3ETest%3C%2Fa%3E', 'test'
          3        ASSIGN                                                   !1, ~3
    9     4        INIT_FCALL                                               'array_walk_recursive'
          5        SEND_REF                                                 !1
          6        SEND_VAL                                                 'mySanitizer'
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function mysanitizer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iIATr
function name:  mySanitizer
number of ops:  9
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'htmlspecialchars'
          2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
    8     8      > RETURN                                                   null

End of function mysanitizer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.66 ms | 1003 KiB | 17 Q