3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = ' [ { "id": "11", "from_userid": "1996", "contest_id": "29", "to_userid": "8", "vote_date": "2020-10-06 01:40:04", "count_votes": "1" }, { "id": "1", "from_userid": "82", "contest_id": "29", "to_userid": "94", "vote_date": "2020-09-03 07:06:36", "count_votes": "1" }, { "id": "2", "from_userid": "82", "contest_id": "29", "to_userid": "98", "vote_date": "2020-09-03 07:06:36", "count_votes": "0" } ]'; $arr = json_decode($json, true); $max = max(array_column($arr, 'count_votes')); $out = array_filter($arr, function ($o) use ($max) { return $o['count_votes'] == $max; }); print_r($out);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hKJ2u
function name:  (null)
number of ops:  25
compiled vars:  !0 = $json, !1 = $arr, !2 = $max, !3 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '++%5B%0A++++++++++++++++%7B%0A++++++++++++++++++++%22id%22%3A+%2211%22%2C%0A++++++++++++++++++++%22from_userid%22%3A+%221996%22%2C%0A++++++++++++++++++++%22contest_id%22%3A+%2229%22%2C%0A++++++++++++++++++++%22to_userid%22%3A+%228%22%2C%0A++++++++++++++++++++%22vote_date%22%3A+%222020-10-06+01%3A40%3A04%22%2C%0A++++++++++++++++++++%22count_votes%22%3A+%221%22%0A++++++++++++++++%7D%2C%0A++++++++++++++++%7B%0A++++++++++++++++++++%22id%22%3A+%221%22%2C%0A++++++++++++++++++++%22from_userid%22%3A+%2282%22%2C%0A++++++++++++++++++++%22contest_id%22%3A+%2229%22%2C%0A++++++++++++++++++++%22to_userid%22%3A+%2294%22%2C%0A++++++++++++++++++++%22vote_date%22%3A+%222020-09-03+07%3A06%3A36%22%2C%0A++++++++++++++++++++%22count_votes%22%3A+%221%22%0A++++++++++++++++%7D%2C%0A+++++++++++++++%7B%0A++++++++++++++++++++%22id%22%3A+%222%22%2C%0A++++++++++++++++++++%22from_userid%22%3A+%2282%22%2C%0A++++++++++++++++++++%22contest_id%22%3A+%2229%22%2C%0A++++++++++++++++++++%22to_userid%22%3A+%2298%22%2C%0A++++++++++++++++++++%22vote_date%22%3A+%222020-09-03+07%3A06%3A36%22%2C%0A++++++++++++++++++++%22count_votes%22%3A+%220%22%0A++++++++++++++++%7D%0A++++++++++++%5D'
   30     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   32     6        INIT_FCALL                                               'max'
          7        INIT_FCALL                                               'array_column'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 'count_votes'
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   33    14        INIT_FCALL                                               'array_filter'
         15        SEND_VAR                                                 !1
         16        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         17        BIND_LEXICAL                                             ~10, !2
   35    18        SEND_VAL                                                 ~10
   33    19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   36    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
         24      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hKJ2u
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $o, !1 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   34     2        FETCH_DIM_R                                      ~2      !0, 'count_votes'
          3        IS_EQUAL                                         ~3      !1, ~2
          4      > RETURN                                                   ~3
   35     5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.43 ms | 1009 KiB | 18 Q