3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "surname": "", "name": "Andrea Fiore", "city": "Crocino", "address": "via Emo Mannucci, 2", "telephone": "123456789", "email": "x@gmail.com", "startData": "2019-07-04", "finishData": "2019-07-25", "cardId": "2", "state": "true" } ]'; $data = json_decode($json, true); $filter = array_filter($data, function($row) { return $row['email'] == 'x@gmail.com'; }); if(count(($indexs = array_keys($filter))) == 1) { $data[$indexs[0]] = array( 'foo' => 'bar', ); } var_dump($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/nJHgO
function name:  (null)
number of ops:  26
compiled vars:  !0 = $json, !1 = $data, !2 = $filter, !3 = $indexs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%0A++++%7B%0A++++++++%22surname%22%3A+%22%22%2C%0A++++++++%22name%22%3A+%22Andrea+Fiore%22%2C%0A++++++++%22city%22%3A+%22Crocino%22%2C%0A++++++++%22address%22%3A+%22via+Emo+Mannucci%2C+2%22%2C%0A++++++++%22telephone%22%3A+%22123456789%22%2C%0A++++++++%22email%22%3A+%22x%40gmail.com%22%2C%0A++++++++%22startData%22%3A+%222019-07-04%22%2C%0A++++++++%22finishData%22%3A+%222019-07-25%22%2C%0A++++++++%22cardId%22%3A+%222%22%2C%0A++++++++%22state%22%3A+%22true%22%0A++++%7D%0A%5D'
   18     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   20     6        INIT_FCALL                                               'array_filter'
          7        SEND_VAR                                                 !1
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnJHgO%3A20%240'
   22     9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
   20    11        ASSIGN                                                   !2, $8
   24    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $10     
         15        ASSIGN                                           ~11     !3, $10
         16        COUNT                                            ~12     ~11
         17        IS_EQUAL                                                 ~12, 1
         18      > JMPZ                                                     ~13, ->22
   25    19    >   FETCH_DIM_R                                      ~14     !3, 0
         20        ASSIGN_DIM                                               !1, ~14
   26    21        OP_DATA                                                  <array>
   30    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FnJHgO%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nJHgO
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        FETCH_DIM_R                                      ~1      !0, 'email'
          2        IS_EQUAL                                         ~2      ~1, 'x%40gmail.com'
          3      > RETURN                                                   ~2
   22     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FnJHgO%3A20%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.5 ms | 1400 KiB | 21 Q