3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This code should loop through $data, converting null to 0. */ $data = json_decode('{"last":"0.692776960","high":"0.692776960","low":"0.692776960","avg":0.6928,"vol":"0.252273837","vols":{"bid":null,"ask":null}}', true); $new_data = $data; array_walk_recursive($new_data, function (&$value) { if ($value === null) { $value = 0; } }); var_dump($new_data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AeUP6
function name:  (null)
number of ops:  15
compiled vars:  !0 = $data, !1 = $new_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22last%22%3A%220.692776960%22%2C%22high%22%3A%220.692776960%22%2C%22low%22%3A%220.692776960%22%2C%22avg%22%3A0.6928%2C%22vol%22%3A%220.252273837%22%2C%22vols%22%3A%7B%22bid%22%3Anull%2C%22ask%22%3Anull%7D%7D'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    6     5        ASSIGN                                                   !1, !0
    7     6        INIT_FCALL                                               'array_walk_recursive'
          7        SEND_REF                                                 !1
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAeUP6%3A7%240'
   11     9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   12    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAeUP6%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/AeUP6
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->4
    9     3    >   ASSIGN                                                   !0, 0
   11     4    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAeUP6%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.15 ms | 1387 KiB | 19 Q