3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items=array( array( 'orderno' => '150228085016', 'delivery_time' => '1425124096', 'create_time' => '1425174370'), array ( 'orderno' => '150228084786', 'delivery_time' => '1425124096', 'create_time' => '1425174374'), array ( 'orderno' => '150228090539', 'delivery_time' => '1425123584', 'create_time' => '1425174387') ); $items = array_map(function ($item) { $item['delivery_time'] = date('Y-m-d', $item['delivery_time']); $item['create_time'] = date('Y-m-d', $item['create_time']); return $item; },$items); print_r( $items); var_dump(mb_detect_encoding('哈哈') == 'UTF-8'); function insertAt($items, $index, $value) { array_splice($items, $index, 0, $value); return $items; } $items= ['苹果','橘子','梨','菠萝','香蕉','火龙果'] ; $items=insertAt($items, 2 , '橙子'); print_r( $items);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoVcr
function name:  (null)
number of ops:  28
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJoVcr%3A18%240'
   22     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
   18     6        ASSIGN                                                   !0, $3
   24     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   27    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'mb_detect_encoding'
         12        SEND_VAL                                                 '%E5%93%88%E5%93%88'
         13        DO_ICALL                                         $6      
         14        IS_EQUAL                                         ~7      $6, 'UTF-8'
         15        SEND_VAL                                                 ~7
         16        DO_ICALL                                                 
   34    17        ASSIGN                                                   !0, <array>
   35    18        INIT_FCALL                                               'insertat'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 2
         21        SEND_VAL                                                 '%E6%A9%99%E5%AD%90'
         22        DO_FCALL                                      0  $10     
         23        ASSIGN                                                   !0, $10
   36    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJoVcr%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoVcr
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        FETCH_DIM_R                                      ~2      !0, 'delivery_time'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        ASSIGN_DIM                                               !0, 'delivery_time'
          7        OP_DATA                                                  $3
   20     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'Y-m-d'
         10        FETCH_DIM_R                                      ~5      !0, 'create_time'
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
         13        ASSIGN_DIM                                               !0, 'create_time'
         14        OP_DATA                                                  $6
   21    15      > RETURN                                                   !0
   22    16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJoVcr%3A18%240

Function insertat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoVcr
function name:  insertAt
number of ops:  11
compiled vars:  !0 = $items, !1 = $index, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   31     3        INIT_FCALL                                               'array_splice'
          4        SEND_REF                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 0
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                                 
   32     9      > RETURN                                                   !0
   33    10*     > RETURN                                                   null

End of function insertat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.39 ms | 1403 KiB | 26 Q