3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "credit_card": { "cvc": "123", "expiry": { "month": "12", "year": "2019" }, "name": "Julian", "number": "5123450000000008", "token": null }, "amount": "10", "currency": "AUD", "gateway": { "line_of_business": "eWallet", "service": "default", "username": null }, "external_id": "my external id", "reference": "julian test", "remitter_name": null, "request_id": "1529561070", "statement_description": null, "security_id": null }'; $array = json_decode($json, true); function test_print($item, $key, &$array) { if ($item === null) unset($array[$key]); } array_walk_recursive($array, 'test_print'); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmP09
function name:  (null)
number of ops:  14
compiled vars:  !0 = $json, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A++%22credit_card%22%3A+%7B%0A++++%22cvc%22%3A+%22123%22%2C%0A++++%22expiry%22%3A+%7B%0A++++++%22month%22%3A+%2212%22%2C%0A++++++%22year%22%3A+%222019%22%0A++++%7D%2C%0A++++%22name%22%3A+%22Julian%22%2C%0A++++%22number%22%3A+%225123450000000008%22%2C%0A++++%22token%22%3A+null%0A++%7D%2C%0A++%22amount%22%3A+%2210%22%2C%0A++%22currency%22%3A+%22AUD%22%2C%0A++%22gateway%22%3A+%7B%0A++++%22line_of_business%22%3A+%22eWallet%22%2C%0A++++%22service%22%3A+%22default%22%2C%0A++++%22username%22%3A+null%0A++%7D%2C%0A++%22external_id%22%3A+%22my+external+id%22%2C%0A++%22reference%22%3A+%22julian+test%22%2C%0A++%22remitter_name%22%3A+null%2C%0A++%22request_id%22%3A+%221529561070%22%2C%0A++%22statement_description%22%3A+null%2C%0A++%22security_id%22%3A+null%0A%7D'
   29     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   36     6        INIT_FCALL                                               'array_walk_recursive'
          7        SEND_REF                                                 !1
          8        SEND_VAL                                                 'test_print'
          9        DO_ICALL                                                 
   38    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function test_print:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/qmP09
function name:  test_print
number of ops:  7
compiled vars:  !0 = $item, !1 = $key, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   33     3        TYPE_CHECK                                    2          !0
          4      > JMPZ                                                     ~3, ->6
          5    >   UNSET_DIM                                                !2, !1
   34     6    > > RETURN                                                   null

End of function test_print

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.33 ms | 1401 KiB | 19 Q