3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{"name":"xxxxxxxx","phoneNumber":"222223wssd","amount":50.00,"won":false,"date":"2019-05-01T02:35:38"}, {"name":"xxxxxxxx","phoneNumber":"222223wssd","amount":60.05,"won":false,"date":"2019-05-01T09:01:04"}]'; $arr = json_decode($json, true); $unique = array_column($arr, null, 'phoneNumber'); echo count($unique); Var_dump($unique);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A4p6d
function name:  (null)
number of ops:  18
compiled vars:  !0 = $json, !1 = $arr, !2 = $unique
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B%22name%22%3A%22xxxxxxxx%22%2C%22phoneNumber%22%3A%22222223wssd%22%2C%22amount%22%3A50.00%2C%22won%22%3Afalse%2C%22date%22%3A%222019-05-01T02%3A35%3A38%22%7D%2C%0A%7B%22name%22%3A%22xxxxxxxx%22%2C%22phoneNumber%22%3A%22222223wssd%22%2C%22amount%22%3A60.05%2C%22won%22%3Afalse%2C%22date%22%3A%222019-05-01T09%3A01%3A04%22%7D%5D'
    6     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    7     6        INIT_FCALL                                               'array_column'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 null
          9        SEND_VAL                                                 'phoneNumber'
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    9    12        COUNT                                            ~8      !2
         13        ECHO                                                     ~8
   11    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.45 ms | 1012 KiB | 16 Q