3v4l.org

run code in 300+ PHP versions simultaneously
<?php $database=array(array("Test 1","021"),array("Test 2","033"),array("Test 3","022"),array("Test 3","022"),array("Test 3","033"),array("Test 2","022"),array("Test 2","021")); $source=array(); foreach($database as $row) { $source[]=json_encode(array("message"=>$row[0],"number"=>$row[1])); } $unique=array_map(function($str){ return json_decode($str,true); },array_unique($source)); print_r($unique);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/eXNGl
function name:  (null)
number of ops:  28
compiled vars:  !0 = $database, !1 = $source, !2 = $row, !3 = $unique
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $6      !0, ->14
          3    > > FE_FETCH_R                                               $6, !2, ->14
    6     4    >   INIT_FCALL                                               'json_encode'
          5        FETCH_DIM_R                                      ~8      !2, 0
          6        INIT_ARRAY                                       ~9      ~8, 'message'
          7        FETCH_DIM_R                                      ~10     !2, 1
          8        ADD_ARRAY_ELEMENT                                ~9      ~10, 'number'
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $11     
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  $11
    4    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $6
    8    15        INIT_FCALL                                               'array_map'
         16        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeXNGl%3A8%240'
   10    17        SEND_VAL                                                 ~12
         18        INIT_FCALL                                               'array_unique'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $13     
         21        SEND_VAR                                                 $13
         22        DO_ICALL                                         $14     
    8    23        ASSIGN                                                   !3, $14
   11    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FeXNGl%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.36 ms | 1400 KiB | 23 Q