3v4l.org

run code in 300+ PHP versions simultaneously
<?php function recurse(&$arr) { if (is_array($arr)) { foreach($arr as $i) { recurse($i); } } else { $i = $i . "appended"; echo $i; } } function utf8_encode_array(&$array) { if (is_array($array)) { array_walk($array, 'utf8_encode_array'); } else { $array = utf8_encode($array); } } function utf8_encode_array_recursive(&$arr) { if (is_array($arr)) { array_walk_recursive($arr, function(&$value, $key) { $value = utf8_encode($value); }); } else { $arr = utf8_encode($arr); } } $arr = range(1, 100); $start1 = microtime(true); recurse($arr); echo "Recurse function: " . (microtime(true) - $start1) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZh1C
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arr, !1 = $start1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 100
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
   37     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
   38     9        INIT_FCALL                                               'recurse'
         10        SEND_REF                                                 !0
         11        DO_FCALL                                      0          
   39    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $7      
         15        SUB                                              ~8      $7, !1
         16        CONCAT                                           ~9      'Recurse+function%3A+', ~8
         17        CONCAT                                           ~10     ~9, '%0A'
         18        ECHO                                                     ~10
         19      > RETURN                                                   1

Function recurse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZh1C
function name:  recurse
number of ops:  15
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~2, ->11
    5     3    > > FE_RESET_R                                       $3      !0, ->9
          4    > > FE_FETCH_R                                               $3, !1, ->9
    6     5    >   INIT_FCALL_BY_NAME                                       'recurse'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
    5     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $3
         10      > JMP                                                      ->14
    9    11    >   CONCAT                                           ~5      !1, 'appended'
         12        ASSIGN                                                   !1, ~5
   10    13        ECHO                                                     !1
   12    14    > > RETURN                                                   null

End of function recurse

Function utf8_encode_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZh1C
function name:  utf8_encode_array
number of ops:  13
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->8
   17     3    >   INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !0
          5        SEND_VAL                                                 'utf8_encode_array'
          6        DO_ICALL                                                 
          7      > JMP                                                      ->12
   19     8    >   INIT_FCALL                                               'utf8_encode'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        ASSIGN                                                   !0, $3
   21    12    > > RETURN                                                   null

End of function utf8_encode_array

Function utf8_encode_array_recursive:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZh1C
function name:  utf8_encode_array_recursive
number of ops:  14
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->9
   26     3    >   INIT_FCALL                                               'array_walk_recursive'
          4        SEND_REF                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMZh1C%3A26%240'
   28     6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
          8      > JMP                                                      ->13
   30     9    >   INIT_FCALL                                               'utf8_encode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        ASSIGN                                                   !0, $4
   32    13    > > RETURN                                                   null

End of function utf8_encode_array_recursive

Function %00%7Bclosure%7D%2Fin%2FMZh1C%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZh1C
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $value, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   27     2        INIT_FCALL                                               'utf8_encode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   28     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMZh1C%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.54 ms | 1407 KiB | 24 Q