3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TH { public function entities($val) { $val = htmlentities($val); } } $th = new TH($val); $arr = array('f' => '<pizza>', 'g' => '<onions>'); array_walk($arr, create_function('&$a', '$a = $th->entities($a);')); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebJPJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $th, !1 = $val, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'TH'
          1        SEND_VAR_EX                                              !1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    8     4        ASSIGN                                                   !2, <array>
    9     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !2
          7        INIT_FCALL_BY_NAME                                       'create_function'
          8        SEND_VAL_EX                                              '%26%24a'
          9        SEND_VAL_EX                                              '%24a+%3D+%24th-%3Eentities%28%24a%29%3B'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
   10    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class TH:
Function entities:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebJPJ
function name:  entities
number of ops:  6
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    5     5      > RETURN                                                   null

End of function entities

End of class TH.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.16 ms | 1395 KiB | 22 Q