3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{"NO":"1","ID_OBJECT":"A045"},{"NO":"2","ID_OBJECT":"A049"}]'; $arr = json_decode($json, true); array_unshift($arr , [ "NO" => "NULL", "ID_OBJECT" => "NULL" ]); $json = json_encode($arr); echo $json;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lg7Yj
function name:  (null)
number of ops:  16
compiled vars:  !0 = $json, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22NO%22%3A%221%22%2C%22ID_OBJECT%22%3A%22A045%22%7D%2C%7B%22NO%22%3A%222%22%2C%22ID_OBJECT%22%3A%22A049%22%7D%5D'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    4     6        INIT_FCALL                                               'array_unshift'
          7        SEND_REF                                                 !1
    5     8        SEND_VAL                                                 <array>
    4     9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !0, $6
    9    14        ECHO                                                     !0
   10    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.97 ms | 1017 KiB | 16 Q