3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array ( 0 => array ( 'php' => 5.3, ), 1 => array ( 'php' => 5.3, ), 2 => array ( 'php' => 5.3, ), ); $loopSize = 100000; $t = microtime(true); for ($i = 0; $i < $loopSize; $i++) { $a = array_map('serialize', $a); $a = array_unique($a); $a = array_map('unserialize', $a); } echo 'serialize'; var_dump($a); echo microtime(true) - $t."\n"; $t = microtime(true); for ($i = 0; $i < $loopSize; $i++) { $a = array_map('json_encode', $a); $a = array_unique($a); $a = array_map(function($v) { return json_decode($v, true);}, $a); } echo 'json'; var_dump($a); echo microtime(true) - $t."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 8
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 41
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 41
Branch analysis from position: 59
Branch analysis from position: 41
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 8
Branch analysis from position: 25
Branch analysis from position: 8
filename:       /in/tlhff
function name:  (null)
number of ops:  70
compiled vars:  !0 = $a, !1 = $loopSize, !2 = $t, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, 100000
   18     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   19     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->23
   20     8    >   INIT_FCALL                                               'array_map'
          9        SEND_VAL                                                 'serialize'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !0, $9
   21    13        INIT_FCALL                                               'array_unique'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !0, $11
   22    17        INIT_FCALL                                               'array_map'
         18        SEND_VAL                                                 'unserialize'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !0, $13
   19    22        PRE_INC                                                  !3
         23    >   IS_SMALLER                                               !3, !1
         24      > JMPNZ                                                    ~16, ->8
   24    25    >   ECHO                                                     'serialize'
   25    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
   26    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $18     
         32        SUB                                              ~19     $18, !2
         33        CONCAT                                           ~20     ~19, '%0A'
         34        ECHO                                                     ~20
   28    35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $21     
         38        ASSIGN                                                   !2, $21
   29    39        ASSIGN                                                   !3, 0
         40      > JMP                                                      ->57
   30    41    >   INIT_FCALL                                               'array_map'
         42        SEND_VAL                                                 'json_encode'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $24     
         45        ASSIGN                                                   !0, $24
   31    46        INIT_FCALL                                               'array_unique'
         47        SEND_VAR                                                 !0
         48        DO_ICALL                                         $26     
         49        ASSIGN                                                   !0, $26
   32    50        INIT_FCALL                                               'array_map'
         51        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ftlhff%3A32%240'
         52        SEND_VAL                                                 ~28
         53        SEND_VAR                                                 !0
         54        DO_ICALL                                         $29     
         55        ASSIGN                                                   !0, $29
   29    56        PRE_INC                                                  !3
         57    >   IS_SMALLER                                               !3, !1
         58      > JMPNZ                                                    ~32, ->41
   34    59    >   ECHO                                                     'json'
   35    60        INIT_FCALL                                               'var_dump'
         61        SEND_VAR                                                 !0
         62        DO_ICALL                                                 
   36    63        INIT_FCALL                                               'microtime'
         64        SEND_VAL                                                 <true>
         65        DO_ICALL                                         $34     
         66        SUB                                              ~35     $34, !2
         67        CONCAT                                           ~36     ~35, '%0A'
         68        ECHO                                                     ~36
         69      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ftlhff%3A32%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tlhff
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ftlhff%3A32%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.45 ms | 1400 KiB | 23 Q